Checking the domain resolution settings

The source of truth when it comes to DNS configuration on a system is generally the resolver file, /etc/resolv.conf, although increasingly this file isn't used directly, and is instead managed by external programs.

In the case of CentOS, the resolv.conf file is managed by our friend network manager, and on other systems, it might be systemd-resolved.

Have a look at your resolv.conf file:

$ cat /etc/resolv.conf 
# Generated by NetworkManager
search discworld
nameserver 10.0.2.3
search in the previous code is the search list for hostname lookup. It's generated by looking at the domain the box is sitting on.
nameserver is the value of our DNS resolver, in this case, the VirtualBox default.

This tells us that the network manager is the program that's populated our file.

We can then use nmcli to list the DNS server it knows about:

$ nmcli -f ipv4.dns,ipv4.ignore-auto-dns connection show System\ eth0
ipv4.dns: --
ipv4.ignore-auto-dns: no

With the preceding code, we're using nmcli with two filters, ipv4.dns and ipv4.ignore-auto-dns, to check our default interface (the eth0 system, in this case).

The value of ipv4.dns isn't set, meaning that it's unlikely to be reading the value from a configuration directive on the interface.

The value of ipv4.ignore-auto-dns is set, and we can tell from the no value that we're not ignoring the auto DNS allocation from the DHCP server.