Well, if you are actually searching for a job, don’t give months of notice before you plan to leave, at least before you’ve accepted, or at least planning to accept another position yet. If you were an HR manager, you would have preferred to know the notice because it’d be easier on your side. But that’s not how it really works. Giving extra early notices isn’t a regular practice, and you don’t want to mess up the relationship with your existing workplace.
If your boss is aware of the fact that you’re searching for a job, he/she might already start planning for your departure. And if your boss plans to take your replacement, you might even have to leave before you even planned.
Furthermore, if your company knows you’re looking for the way out, you could end up on their layoff lists if they are planning to make cuts. Also, as per corporate practices, it’s uncommon for such notices to be given before such a long time.
It’s absolutely alright if you’re looking forward to another journey. Your first step should be to confirm the place you plan to join. After that, you slowly depart from your company. Don’t give anyone the idea you’re saying goodbye before you know you’re going someplace else, for sure.