Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.