« Back to Networking: Frequently Asked Questions

How to see which DNS server is used

Systems using systemd have the resolvectl command to show the configured DNS servers. It also show the server that is currently active.

Show active DNS configuration

Run the resolvectl command without any options to see the status. The configured DNS servers will be displayed, including the one that is currently being used.

# resolvectl
Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (ens18)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.10
       DNS Servers: 192.168.1.10 192.168.1.11
        DNS Domain: internal.example.com

Not using systemd?

When systemd is not being used, then typically the first DNS server configured in the file /etc/resolv.conf is used for processing the DNS requests.

Learn more about resolvectl

This article uses the resolvectl command to achieve its tasks. Want to learn how to use it or additional options that may be available?

Other questions related to Networking

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!