In order to improve the performance of the tuned mass damper (TMD) with a smaller physical mass for machining vibration suppression and energy harvesting, a dual-functional inerter-based damper, called electromagnetic tuned inerter damper (ETID), is proposed. To evaluate the performance of the ETID, the model of coupled ETID and a single degree of freedom (SDOF) system has been established. The H2 optimal design of the ETID-SDOF system has been conducted, whose goal is to minimize the value of the root mean square (RMS) of the displacement and absolute acceleration of the SDOF system. The analytical solutions of the design parameters of the ETID-SDOF system, namely, frequency ratio and damping ratio, have been derived. The control performance and robustness for the undamped SDOF system with ETID have been evaluated via parametric study compared with the undamped SDOF system with the TMD system. The potential other layouts of the ETID are also discussed. The influence of the structural damping on design parameters and performance has also been investigated.