On 08/26/2018 06:25 AM, TE Dukes wrote:

Made the change above in nsswitch, rebooted, ran dig @localhost localhost +short
Got: dig: couldn't get address for 'localhost': failure

That's a secondary issue.  A properly configured DNS server *should* answer correctly for "localhost".  Yours doesn't.  It's broken.  Red Hat ships ISC Bind with a working configuration (/etc/named.rfc1912.zones).  I'm not sure whether you're using something else, or if you've removed the RFC1912 zones.  Fix that later.

"host" and "dig" are both DNS tools, and won't tell you if your files are being used properly.  While you're troubleshooting the libc name resolution system, use "getent".  "getent hosts localhost" and "getent hosts 127.0.0.1" should return something that looks vaguely like the data in /etc/hosts.  You can also verify that it works in practice using "telnet localhost 25" to verify that you can reach services running on the local system.
_______________________________________________
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos

Reply via email to