December 2018
Beginner
826 pages
22h 54m
English
To use a DNS server of our choosing, we should use nmcli.
In the following code, we're setting our own DNS server value (1.1.1.1) and we're flipping the truth value of ipv4.ignore-auto-dns from no to yes:
$ sudo nmcli connection modify System\ eth0 ipv4.dns "1.1.1.1" ipv4.ignore-auto-dns "yes"
Note how both of these fields can be modified on one line.
Reload the interface configuration using the following:
$ sudo nmcli connection up System\ eth0
Look in /etc/resolv.conf for good measure, just to check:
$ cat /etc/resolv.conf # Generated by NetworkManagernameserver 1.1.1.1
Then, run dig:
$ dig bbc.co.uk; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7 <<>> bbc.co.uk;; global options: +cmd;; Got answer:;; ->>HEADER<<- ...
Read now
Unlock full access