Your cart is currently empty!
How to Check DNS Server IP Address in Linux
When troubleshooting network issues or verifying system settings, knowing which DNS server your Linux machine is using can save you a lot of time. DNS (Domain Name System) is what translates human-readable domain names (like google.com) into IP addresses. If the DNS server is slow or misconfigured, you’ll experience delays or even connection failures.
This guide shows you several ways to check the DNS server IP address in Linux.
1. Check /etc/resolv.conf
Traditionally, Linux systems store DNS settings in the /etc/resolv.conf file. You can open it with:
cat /etc/resolv.confYou’ll see something like:
nameserver 8.8.8.8
nameserver 8.8.4.4Here, 8.8.8.8 and 8.8.4.4 are Google’s public DNS servers.
⚠️ Note: On modern systems using systemd-resolved, this file may just point to a stub resolver (127.0.0.53).
2. Use systemd-resolve (or resolvectl)
If your system runs systemd, you can check DNS details with:
systemd-resolve --statusor (on newer distributions):
resolvectl statusThis command shows DNS servers per network interface, along with other useful info.
3. Use nmcli (for NetworkManager)
If you’re on a system managed by NetworkManager (common on desktops), you can run:
nmcli dev show | grep DNSYou’ll get output like:
IP4.DNS[1]: 192.168.1.1
IP4.DNS[2]: 8.8.8.8This shows the DNS servers assigned to your system.
4. Use dig or nslookup to See Which DNS Is Queried
You can also test which DNS server your queries are hitting. For example:
dig google.comAt the bottom of the output, look for the SERVER line:
;; SERVER: 8.8.8.8#53(8.8.8.8)That’s the DNS server used for the query.
Similarly, with nslookup:
nslookup google.comYou’ll see something like:
Server: 8.8.8.8
Address: 8.8.8.8#535. Check Active Network Config with ip or ifconfig
Sometimes your DNS is provided via DHCP. To confirm, you can inspect your network configuration:
nmcli device showor
cat /run/systemd/resolve/resolv.confThese files often reflect the DNS servers dynamically assigned by your router or ISP.
Wrapping Up
Linux offers multiple ways to check which DNS server you’re using. The right method depends on your distribution and setup:
/etc/resolv.conffor quick checks.systemd-resolveorresolvectlif you’re on systemd.nmcliif you use NetworkManager.digornslookupto confirm which server answers queries.
Knowing where your system points for DNS is essential for fixing slow lookups, connection issues, or just confirming your machine uses the DNS server you expect.
💡 Support the Site
If this guide helped you, consider supporting us by trying Opera:
🔥 Download Opera GX (Gamer’s Browser)
🌍 Try Opera One (Multigeo)
Every install helps keep COMPUTER EVERYWHERE running — thank you! 🙌

Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!
