After editing etc/hosts and hostname, 'unable to resolve host' still exist on my terminal, I still don't know what is the cause. Although my computer and my terminal runs so well. I'm only using single OS Ubuntu 12.04.1
-
1Could you please post an example of what you type and the response you get? Also, adding more tags can broaden the viewership of your question to solicit more answers. I added dns for you just now.– Randall CookJan 27, 2013 at 6:37
-
did you reboot?– don.joeyJan 27, 2013 at 7:16
-
Yes, I did a reboot.– obetusJan 27, 2013 at 8:59
Add a comment
|
1 Answer
To change the active system hostname to, e.g., 'foo' it does not suffice to edit /etc/hostname. You have to reboot or run sudo hostname foo
. Also make sure that there is a line in /etc/hosts for 'foo', either
127.0.1.1 foo
if foo has no network connectivity or gets an address via DHCP, or
<IP-address> foo
if foo has a static IP address.
-
I followed your instruction., then reboot. I have an internet connection. But, "unable to resolve host" still there.– obetusJan 29, 2013 at 4:49
-
-
Contents of my /etc/nsswitch.conf file are now attached on the description above.– obetusJan 29, 2013 at 11:19
-
I suspect that the problem is that you have selected a hostname with a capital letter. It's conventional to use all-lower-case hostnames. Try making the host name "precise" with a lower-case pee. (However, I tried changing the name of my machine to a name starting with a capital letter and didn't encounter a problem with sudo. YMMV.)– jdthoodJan 29, 2013 at 11:39
-