This is a plain vanilla fresh install of FreeBSD 13.1. The resolv.conf file is as follows and Unbound is not enabled.
nameserver 192.0.2.1
DNS resolution on the local machine is ignoring /etc/hosts
. What is missing from the configuration?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communityPossibly your assumption that DNS includes entries from /etc/hosts
.
All commands/tools designed to test DNS such as dig
, nslookup
, host
and such only query DNS servers and by default use the DNS server that is configured in /etc/resolv.conf
.
To test how the C library resolver works, and all programs that use the system resolver routines who do honour /etc/nsswitch.conf
precedence and which normally prefer the hosts file over DNS, requires testing with something like getent
:
getent hosts some.hostname.in.etc.hosts
getent hosts IP.in.etc.hosts