Chugalug Linux Users Group- Hosts file
CHUGALUG
Chattanooga
Unix Gnu
and Linux
User Group
Recent Keywords:
From: John Aldrich ------------------------------------------------------ Ok, on my new (to me) KUbuntu notebook, I have a hosts file which lists the IP addresses of my local machines, including my Fedora box and my Windoze box. I am unable to ping either of those machines by name and "host" fails to resolve it. I copied and pasted the information from my hosts file on the Fedora box which DOES work. Any idea why the different behavior? Do I need to modify my network information on the Ubuntu laptop somehow? Thanks!

=============================================================== From: William Wade ------------------------------------------------------ Copy the output on cat /etc/nsswitch.conf It might be that your resolve order is mixed up. There are other options, but this is an easy check.

=============================================================== From: Bret McHone ------------------------------------------------------ Did you copy/paste the entire hosts file?

=============================================================== From: Lynn Dixon ------------------------------------------------------ +1 to what William said. IT could be a mis-ordered nsswitch.conf. Are you running NetworkManager? It will re-write a resolv.conf file, so make sure it isn;t overwriting the one you hand built.

=============================================================== From: John Aldrich ------------------------------------------------------ Not the entire thing... the hosts file from Fedora had the name/IP of the Fedora box, which I didn't think was appropriate for another machine of a different name. :D

=============================================================== From: John Aldrich ------------------------------------------------------ Ok, I never messed with that file on either computer. Here's the contents of the laptop nssswitch: /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat hosts: files mdns4

=============================================================== From: wes ------------------------------------------------------ as a side note, the "host" command does not make use of the hosts file. It is specifically a DNS server querying tool. Ping is the best way for you to test hosts file entries. -wes

=============================================================== From: wes ------------------------------------------------------ Please paste your hosts file to the list, and then your ping commands which are failing. Your wording suggests that you may believe an entry in the hosts file for another machine has some impact on the machine's self-identification. This is not the case. -wes

=============================================================== From: John Aldrich ------------------------------------------------------ wrote: It's working now. I may not have actually pinged last night... I was tired when I was working on it last night. :D I was concerned that putting the "127.0.0.1" entry in from the hosts for a different machine might affect the self-identification. I didn't know if it would cause problems or not and I didn't want to take a chance.

=============================================================== From: wes ------------------------------------------------------ It would cause problems, just not that one. That would cause the machine with that entry in its hosts file to be unable to reach the other machine by that name. -wes

=============================================================== From: Dave Brockman ------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

=============================================================== From: Dave Brockman ------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Say what? Any entry for 127.0.0.1 should look like: 127.0.0.1 localhost localhost.localdomain host.domain.tld last line is optional and depending what services you run on the box may cause you headaches or be required. Should NOT have an entry pointing to anything else... Regards, dtb -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6luSEACgkQABP1RO+tr2RDBgCfSByZRulFvb9YcqUMpi/zCVOZ 6CUAn3jvCJ7U0R/ZVW6cq3R7O4t891GV =ual3 -----END PGP SIGNATURE-----

=============================================================== From: John Aldrich ------------------------------------------------------