15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started
31.10.2024
9 +1

How to Check Which DNS Servers Are Assigned to a Domain

Whether you're troubleshooting a website outage, migrating to a new hosting provider, or simply auditing your infrastructure, knowing how to check which DNS servers are assigned to a domain is a fundamental skill for any website owner or systems administrator.

DNS (Domain Name System) servers act as the internet's phonebook — they translate human-readable domain names like example.com into machine-readable IP addresses. If your DNS is misconfigured or pointing to the wrong nameservers, your website, email, and other services will fail to resolve correctly. This comprehensive guide covers every reliable method to check DNS server assignments, from beginner-friendly online tools to advanced command-line techniques.

Why Checking Your DNS Servers Matters

Before diving into the methods, it's worth understanding why this check is important:

  • Domain migrations: When moving your site to a new VPS Hosting or dedicated server, you need to confirm that nameservers have been updated correctly.
  • Email deliverability: Incorrect DNS records can cause email routing failures, especially if you rely on Email Hosting services.
  • SSL certificate validation: Many SSL issuance processes require DNS verification. If your nameservers are wrong, certificate provisioning will fail.
  • Security auditing: Unexpected nameserver changes can indicate unauthorized access or domain hijacking.

Method 1: Use Online DNS Lookup Tools

Online DNS lookup tools are the fastest and most accessible way to check nameservers — no installation or technical knowledge required.

ToolURLBest For
MXToolboxmxtoolbox.comFull DNS record analysis
WhatsMyDNSwhatsmydns.netGlobal DNS propagation checks
NSLookup.ionslookup.ioNameserver and record lookup
DNSChecker.orgdnschecker.orgMulti-region propagation testing

How to Use MXToolbox

  1. Navigate to mxtoolbox.com
  2. Enter your domain name in the search bar
  3. Select DNS Lookup from the dropdown menu
  4. Review the list of authoritative nameservers returned

How to Use WhatsMyDNS

  1. Visit whatsmydns.net
  2. Enter your domain name and select NS (Name Server) from the record type dropdown
  3. Click Search to view nameserver assignments across multiple global locations

These tools are especially useful for verifying DNS propagation after making changes — they show you what different resolvers around the world currently see for your domain.

Method 2: Command-Line Tools

For system administrators and developers, command-line tools offer greater control, scriptability, and detail. Here are the three most important commands.

2.1 The nslookup Command (Windows, macOS, Linux)

nslookup is universally available across all major operating systems and is the simplest CLI tool for DNS queries.
Basic nameserver lookup:
nslookup -type=ns example.com
Sample output:
Server:  8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
example.com  nameserver = ns1.exampledns.com
example.com  nameserver = ns2.exampledns.com
Query a specific DNS resolver (e.g., Google's public DNS):
nslookup -type=ns example.com 8.8.8.8
This is useful for checking whether a specific resolver has picked up recent DNS changes.
2.2 The dig Command (Linux and macOS)
The dig (Domain Information Groper) command is the preferred tool among network engineers for its verbose, structured output.
Basic NS record query:
dig NS example.com
Sample output:
; <<>> DiG 9.16.1 <<>> NS example.com
;; ANSWER SECTION:
example.com.    86400   IN  NS  ns1.exampledns.com.
example.com.    86400   IN  NS  ns2.exampledns.com.
Short output format (cleaner for scripting):
dig NS example.com +short
Query against a specific nameserver:
dig NS example.com @8.8.8.8
Trace the full DNS resolution path:
dig NS example.com +trace
The +trace flag is particularly powerful — it walks through the entire DNS hierarchy from root servers down to the authoritative nameserver, which is invaluable for diagnosing complex DNS issues.
> Installation note: If dig is not installed on your system, install it with:
> – Ubuntu/Debian: sudo apt install dnsutils

> – CentOS/RHEL: sudo yum install bind-utils

> – macOS: Available by default; or install via Homebrew with brew install bind

2.3 The whois Command

The whois command queries domain registration databases and returns the nameservers recorded at the registrar level — which may differ from what your DNS provider is currently serving.

whois example.com

Look for lines similar to:

Name Server: NS1.EXAMPLEDNS.COM
Name Server: NS2.EXAMPLEDNS.COM

Why this matters: If dig or nslookup shows different nameservers than whois, it typically means DNS propagation is still in progress, or there's a misconfiguration at the registrar level.

> Installation:

> – Ubuntu/Debian: sudo apt install whois

> – Windows: Install via Sysinternals Whois or WSL

Method 3: Check Your Domain Registrar or Hosting Control Panel

If you have administrative access to your domain or hosting account, the control panel is the most direct place to view and manage nameserver settings.

3.1 Domain Registrar Dashboard

  1. Log in to your domain registrar account (e.g., Namecheap, GoDaddy, or AlexHost Domain Registration)
  2. Navigate to your domain list and select the domain you want to inspect
  3. Look for a section labeled DNS, Nameservers, or Name Server Management
  4. The currently assigned nameservers will be listed here

This is also where you update nameservers when switching hosting providers or pointing your domain to a new server.

3.2 Hosting Provider Control Panel

If your DNS is managed through your hosting provider rather than your registrar:

  1. Log in to your hosting control panel (e.g., cPanel, Plesk, or a custom dashboard)
  2. Navigate to the DNS Zone Editor or DNS Management section
  3. Review the NS records listed for your domain

If you're using a VPS with cPanel, the DNS Zone Editor is accessible directly from the cPanel home screen, making it straightforward to verify or update your nameserver configuration.

Method 4: Google Admin Console (For Google Workspace Domains)

If your domain is registered through Google or managed via Google Workspace:

  1. Log in to the Google Admin Console
  2. Navigate to DomainsManage Domains
  3. Click on your domain to view its DNS settings, including assigned nameservers
  4. From here, you can also add or modify DNS records as needed

Method 5: Browser Extensions

For web professionals who frequently check DNS records without switching between tools, browser extensions offer a convenient shortcut.

Recommended extensions:

  • DNS Lookup (Chrome/Firefox) — Quick NS, A, MX, and TXT record lookups
  • DNS Checker (Chrome) — Real-time DNS propagation checks
  • Wappalyzer (Chrome/Firefox) — Identifies hosting and DNS providers

These extensions are particularly useful during website audits or when managing multiple client domains simultaneously.

Method 6: Programmatic DNS Lookup (Python Example)

For developers who need to automate DNS checks, Python's dnspython library provides a clean interface:

import dns.resolver

domain = "example.com"
answers = dns.resolver.resolve(domain, 'NS')

print(f"Nameservers for {domain}:")
for rdata in answers:
    print(f"  {rdata.target}")

Install the library:

pip install dnspython

This approach is ideal for building monitoring scripts that alert you when nameserver records change unexpectedly.

Troubleshooting Common DNS Issues

Even with the right tools, DNS problems can be tricky. Here are the most common issues and how to resolve them.

DNS Propagation Delays

DNS changes can take 24 to 48 hours to propagate globally, though in practice it's often much faster (1–4 hours). During propagation, different users in different locations may see different nameservers.

How to check propagation status:

  • Use whatsmydns.net to see what resolvers in different countries currently return
  • Use dig NS example.com @8.8.8.8 and dig NS example.com @1.1.1.1 to compare Google and Cloudflare resolver results

Mismatch Between WHOIS and Actual DNS

If whois shows different nameservers than dig, it usually means:

  • The registrar update hasn't propagated yet
  • The DNS was changed at the provider level but not updated at the registrar (or vice versa)

Resolution: Ensure both your registrar dashboard and your DNS provider show consistent nameserver records.

DNSSEC Validation Failures

If DNSSEC is enabled on your domain, the cryptographic signatures must match between your DNS provider and the records published at your registrar. A mismatch will cause SERVFAIL errors for users with DNSSEC-validating resolvers.

Diagnostic command:

dig NS example.com +dnssec

Look for the AD (Authenticated Data) flag in the response. If it's absent and DNSSEC is supposed to be active, investigate your DS records at the registrar.

Unexpected Nameserver Changes

If you discover nameservers you didn't configure, treat it as a security incident:

  1. Immediately log in to your registrar and restore the correct nameservers
  2. Enable two-factor authentication on your registrar account
  3. Review your registrar's access logs for unauthorized logins
  4. Consider enabling registrar lock (also called domain lock) to prevent unauthorized transfers or DNS changes

Quick Reference: DNS Lookup Commands

TaskCommand
Check nameservers (nslookup)nslookup -type=ns example.com
Check nameservers (dig)dig NS example.com +short
Trace DNS resolution pathdig NS example.com +trace
Query specific resolverdig NS example.com @1.1.1.1
Check registrar-level nameserverswhois example.com
Verify DNSSECdig NS example.com +dnssec

Choosing the Right DNS Setup for Your Hosting Environment

Your DNS configuration should align with your hosting infrastructure. Here's a quick guide:

  • Shared hosting: Your provider typically manages DNS for you. If you're on Shared Web Hosting, nameservers are usually pre-configured and point to the host's DNS cluster.
  • VPS or dedicated servers: You have full control over DNS. You can run your own nameservers or delegate to a third-party DNS provider. If you're running a Dedicated Server, consider using a managed DNS service for redundancy.
  • SSL certificates: Ensure your DNS records are correctly configured before requesting an SSL Certificate, as domain validation relies on accurate DNS resolution.

Conclusion

Checking which DNS servers are assigned to a domain is a straightforward but critical task in website management. Whether you prefer the simplicity of online tools like MXToolbox and WhatsMyDNS, the precision of command-line utilities like dig and nslookup, or the convenience of your hosting control panel, there's a method suited to every skill level and workflow.

Regularly auditing your DNS configuration helps you catch misconfigurations early, verify that migrations completed successfully, and protect your domain against unauthorized changes. Combined with a reliable hosting infrastructure, proper DNS management ensures your website and services remain accessible, secure, and performant at all times.

15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started