My system is "Unable to resolve" removed entry from /etc/hosts.

During development, I needed to add the custom domain entry to /etc/hosts, stating it resolves to This mapping worked fine.

After I have finished with it and removed the entry, now I see error messages from different tools that claim this my custom name cannot be resolved any longer. Seems that every Java program that attempts to get the local host address is now crashing. I tried to reboot the machine, did not help.

To make possible to work again, I have returned my custom naming to /etc/hosts. Which cleanup is required to get rid of it completely?

1 Answer 1


What isn't in /etc/hosts or registered with DNS, cannot be resolved (nothing stays defined, so removing the lines from this file is all you need to remove the names). /etc/hosts should always exist at least to set the localhost entry. Usually, a default file contains               localhost.localdomain   localhost
::1                     localhost.localdomain   localhost

or something similar. You can add more than one name to any ip if you want.

In short, this file should contain exactly what you need to resolve, but isn't a registred DNS domain. If your custom name isn't a DNS name, you shouldn't remove it if you still want to use it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .