DNS – Client Troubleshooting

Here are the steps:

check you can reach the dns server via port 53. E.g. if our dns server’s ip address is, then we can test using netcat:

[root@client ~]# nc -v 53

Then test with dig:

[root@box1 ~]# dig  @ codingbee.net

; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7_4.2 <<>> @ codingbee.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8790
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

; EDNS: version: 0, flags:; udp: 4096
;codingbee.net.			IN	A

codingbee.net.		12470	IN	A

codingbee.net.		84470	IN	NS	ns1.ukm11.siteground.biz.
codingbee.net.		84470	IN	NS	ns2.ukm11.siteground.biz.

ns1.ukm11.siteground.biz. 12470	IN	A
ns2.ukm11.siteground.biz. 12470	IN	A

;; Query time: 1 msec
;; WHEN: Sun Mar 11 18:40:09 UTC 2018
;; MSG SIZE  rcvd: 146

To configure your client to point to the new dns server, you need to edit /etc/resolv.conf. This in turn is managed via NetworkManager. Any existing dns IP addresses comes from the DHCP protocol.

Now to override dchp's provided dns addresses, you can do it either via the gnome gui, or via the nmcli interactive terminal. We'll demo the nmcli approach. First we get a list of active connections:

$ nmcli connection show --active 

First we disable dhcp setting the dns address:

$ nmcli connection modify System\ enp0s8 ipv4.ignore-auto-dns yes

Then for the chosen connection run the command (use tab+tab to help create this command):

$ nmcli connection modify System\ enp0s8 ipv4.dns ''

Behind the scenes this will end up changing adding a 'DNS1' setting to the corresponding /etc/sysconfig/network-scripts/ifcfg-* file.