I had the problem that my /etc/hosts wasn’t read by the system.
First: Use ping
to test local Hostname lookups, because dig
calls the nameservers directly.
There are two files that can configure in which order the lookup system are tried.
The two systems are the local hosts file and the normal DNS system.
/etc/host.conf
1 2 |
order hosts,bind
multi on |
“order hosts,bind” tells the system to use the hosts file first, and then try bind == DNS system.
/etc/nsswitch.conf
1 |
hosts: files dns |
“hosts: files dns” tells the system to use the hosts files first, and then try DNS system.
Try which file has to be edited, because it is not clear which is used.