Improve work with DNS

 - Add timer for waiting dns responce
 - Change algorithm for work woth localhost name