Why does nslookup/dig/host not resolve hostnames mentioned in /etc/hosts file in Red Hat Enterprise Linux ?
Issue
nslookupordigorhostdoes not resolve hostnames mentioned in/etc/hostsfile- Performing a DNS lookup of a system in
/etc/hostsfails with the following message:
# nslookup server1
Server: 10.x.x.x
Address: 10.x.x.x#53
** server can't find server1: SERVFAIL
Environment
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.