How to check the DNS server IP being used (Ubuntu 18.04+)

If you’re using Ubuntu 18.04+ (or distro based on Ubuntu 18.04) and you would like to know which DNS servers are responsible for your connection, you can try the next options:

Option 1

nmcli dev show | grep DNS



Option 2

systemd-resolve --status


         DNS Servers:
          DNS Domain: ~.

It contains a list under “DNS Servers” organized by link

Option 3

cat /run/systemd/resolve/resolv.conf

The well known file /etc/resolv.conf is now just a symlink to /run/systemd/resolve/stub-resolv.conf

If you want the “old way”, you can point /etc/resolv.conf directly to /run/systemd/resolve/resolv.conf

Leave a Reply

Your email address will not be published. Required fields are marked *