LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Unable to resolve via /etc/hosts (https://www.linuxquestions.org/questions/slackware-14/unable-to-resolve-via-etc-hosts-482951/)

cronicded 09-12-2006 11:45 PM

Unable to resolve via /etc/hosts
 
Hello,

Recently I've run into an issue trying to install new services to a slack 10.2 machine (updated via slapt-get to current), namely the mysql daemon. When running mysql_install_db the machine reports it is unable to resolve localhost and socrates (the name of the machine). I have hostname set to socrates and my /etc/hosts file contains:
Code:

127.0.0.1  localhost socrates
My /etc/host.conf file contains:
Code:

order hosts, bind
multi on

I have been unable to ping the host names: localhost and socrates, however, I can ping 127.0.0.1 without issue. I had tried rebooting the system (after much googling to no avail I decided I try one of the simplest yet uninvestigative approaches. No resolve.

After much fussing I coldn't figure out my issue, and eventually hammered my /etc/resolv.conf ; it contained:
Code:

nameserver 24.93.41.125
nameserver 24.93.41.126
search austin.rr.com

Removing the search line from resolv.conf all of sudden allowed me to ping localhost and resolved it to LOCALHOST 127.0.0.1 However, I was still unable to resolve any other hosts. Further testing I included bunk entries into /etc/hosts such as : 10.0.0.1 test and/or 192.168.0.56 bleh and could not resolve any hosts. iptables -L includes only a minor IP MASQ/NAT setup and there are no other firewall rules for testing purposes. At this point I am confused as to why removing the search line enabled me to resolv localhost (subsequent reboots re-enter the search austin.rr.com line into my resolv.conf line and produce the same issue with localhost. removing it absolves the issue with resolving localhost) but not other hostnames.

To me, it appears to be some type of polling issue with /etc/hosts but I am completely stumped. Does anyone have any ideas or suggestions?

cronicded 09-13-2006 12:18 AM

This was resolved with the help of a friend at work. Apparently my /etc/nsswitch.conf file went missing on my machine. Copying from a similar machine resolved the issue. Never would've found it in a million years.


All times are GMT -5. The time now is 10:08 PM.