How to Find My DNS Server IP Address in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Martins D. Okoi

Martins Divine Okoi is a graduate of Computer Science with a passion for Linux and the Open Source community. He works as a Graphic Designer, Web Developer, and programmer.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

9 Responses

  1. rms-mit says:

    Many Linux users these days use a dns cache and so the dns server in resolve.conf is a loopback address to the dns cache on your own PC/Linux.

    systemd’s resolved is also often used but this updates resolve.conf for informational reference. Systemd-Resolved can have different dns servers for different networks concurrently and the resolve.conf will not reflect this but the man pages and status command are very informative.

    network manager also does some things differently. i think it sets up one of these dns caches but id don’t know much about it.

    I keep reading these “how to find my dns” how to pages but have yet to find one that covers the more modern scenarios.

  2. Adonis Tarcio says:

    You missed probably one of the easiest one: nslookup

  3. René Hartman says:

    On my Fedora 29 and RHEL 8 /etc/resolv.conf is still used for listing the nameservers.

    Same for my PureOS, Alpine, TinyCore and Atomic Host…

    My Ubuntu 16.04 LTSB and 18.04 LTSB have and respectively.

  4. Tudor says:

    @Andrew is correct, because modern OSs use a local name server cache.

    • rms-mit says:

      I think you will find this is a dns cache on your local machine. see my other comment on the root article

  5. Tudor says:

    Except that all the modern Desktop Linux distros stopped listing nameservers in /etc/resolve.conf many years ago! If you look in that file now, all you get is, because most now have a local caching nameserver.

  6. Andrew says:

    /etc/resolv.conf says my nameserver is That can’t be right.

  7. René Hartman says:

    How to find your own external IP address?

    $ dig +short

    This works fine on CentOS and RHEL but not on Ubuntu. Looks like Ubuntu’s dig command has less capabilities.

  8. Daniel M Tripp says:

    That’s almost completely wrong and complete deprecated on almost every recent Ubuntu or Debian version I’ve used ! Contents of resolv.conf on my Raspberry Pi running Raspbian Stretch :

    # Generated by resolvconf
    domain LOCAL

    looking at the contents /etc/resolv.conf may have been true 10+ years ago – on a UNIX system like Solaris…

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.