Feb 242021
 

If you’re a networking or sys admin student, you might want to know how to identify the DNS server address of your Linux system on the Command Line.

DNS refers to the Domain Name System, which resolves domain names into IP addresses.

In this case, we’re talking specifically about finding the DNS server on the Linux Mint or Ubuntu desktop via the command line interface.

Identify DNS Server Address via CLI

Here are a few command line tools that should help you identify the DNS server on your Linux Mint system.

I’ve tested the following commands on Linux Mint and Ubuntu.

1. nmcli dev show | grep DNS

$ nmcli dev show | grep DNS
IP4.DNS[1]: 208.67.220.220
IP4.DNS[2]: 208.67.222.222

2. nmcli dev show | grep DNS | sed ‘s/\s\s*/\t/g’ | cut -f 2

$ nmcli dev show | grep DNS | sed 's/\s\s*/\t/g' | cut -f 2
208.67.220.220
208.67.222.222

3. nmcli device show | grep IP4.DNS

$ nmcli device show eno3 | grep IP4.DNS
IP4.DNS[1]: 208.67.220.220
IP4.DNS[2]: 208.67.222.222

4. systemd-resolve –status

You may have to scroll down (press the tab key) to see full output.

systemd-resolve --status
Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      [output truncated]
         DNS Servers: 208.67.220.220
                      208.67.222.222
          DNS Domain: ~.

Sorry, the comment form is closed at this time.