This paper addresses the optimal output regulation problem of linear systems with unknown system dynamics. The exogenous signal is presumed to be generated by a continuous-time linear exosystem. Firstly, we formulate the linear optimal output regulation problem (LOORP). Then, we give an offline solution of LOORP to design the optimal static state-feedback servoregulator by solving an algebraic Riccati equation (ARE) and a regulator equation. Instead of solving these two equations directly, by using state, input and exogenous signals collected online, we employ an approximate/adaptive dynamic programming (ADP) technique to seek online approximations of above equations whereby we get the approximated optimal servoregulator. Rigorous stability analysis shows that the closed-loop linear system is exponentially stable. Also, the output of the plant asymptotically tracks the given reference. Simulation results demonstrate the effectiveness of the proposed approach.