XiaTools

What is Nameserver Lookup and How to Change NS

Updated 09 Oct 2026

An ns lookup is a diagnostic process used to query the Domain Name System (DNS) to find which authoritative nameservers are currently responsible for a specific domain name. When you type a website address into your browser, a query is initiated to discover these nameservers, which in turn point to the correct hosting server IP address. Without this mapping, human-readable domain names like example.com could not translate into machine-readable network destinations.

Understanding how to perform an ns lookup and how to change your nameservers (NS records) is an essential skill for managing domains, migrating websites, and troubleshooting connectivity issues. Whether you are launching a new site or switching providers, knowing how DNS delegation works saves you hours of frustrating downtime.

To check your domain's current delegation instantly without messing with command-line tools, you can use the NS Lookup tool on XiaTools, which queries global root and authoritative servers to show you exact record propagation.

How Nameservers Work Behind the Scenes

When a user enters a domain name into an address bar, the recursive resolver (usually operated by an ISP or a public DNS provider like 1.1.1.1) embarks on a journey to find the content. It starts at the root DNS servers, moves down to the Top-Level Domain (TLD) servers (such as .com), and finally lands on the authoritative nameservers specified for that exact domain.

Your NS records define where this final authority lies. If your domain is registered at Registrar A but hosted at Web Host B, your registrar needs to have the NS records of Web Host B configured so that the rest of the internet knows where to ask for your A, AAAA, and MX records.

The Anatomy of an NS Record

An NS record is simple in structure. It contains a domain name and the hostname of the authoritative server. Here is what standard NS records look like in a zone file:

example.com.      86400   IN  NS  ns1.hostingprovider.com.
example.com.      86400   IN  NS  ns2.hostingprovider.com.
  • TTL (Time to Live): The value 86400 represents seconds (24 hours), telling resolvers how long to cache this record.
  • Class: IN stands for Internet.
  • Type: NS specifies that this is a nameserver record.
  • Target: The fully qualified domain name of the nameserver.

How to Perform an NS Lookup

You can query nameservers using various built-in command-line utilities across operating systems, or via web-based network toolkits. Here is how to inspect NS records using common administrative tools.

Using nslookup on Windows and Linux

The traditional nslookup command is available natively in Windows PowerShell, Command Prompt, and Linux terminals. To query the NS records of a domain interactively or directly, follow these steps:

  1. Open your terminal or PowerShell window.
  2. Type nslookup and press Enter to enter interactive mode, or run a direct query.
  3. Set the query type to NS by typing set type=NS.
  4. Enter the domain name you wish to check, such as example.com.
PS C:\Users\Admin> nslookup
> set type=NS
> example.com
Server:  dns.google
Address:  8.8.8.8

Non-authoritative answer:
example.com     nameserver = ns1.example.net
example.com     nameserver = ns2.example.net

Using dig for Advanced DNS Queries

Network engineers prefer the dig (Domain Information Groper) utility for its detailed output and accuracy. To find the nameservers using dig, use the following command:

dig example.com NS +noall +answer

Sample output:

example.com.            3600    IN      NS      ns1.example.net.
example.com.            3600    IN      NS      ns2.example.net.

Step-by-Step Guide: How to Change Your Nameservers

Changing your nameservers moves the authority of your DNS zone from one provider to another (for example, moving from your domain registrar's default nameservers to a cloud DNS provider or a new web host).

Note: Exact menu names and paths differ slightly depending on your specific registrar (such as GoDaddy, Namecheap, Cloudflare, or Route53), but the general workflow remains identical.

Step 1: Gather Your New Nameserver Addresses

Before making any changes, obtain the exact hostnames provided by your new hosting or DNS provider. They usually look like:

  • ns1.newhostdns.com
  • ns2.newhostdns.com

Step 2: Log In to Your Domain Registrar

Navigate to the company where you originally purchased and registered your domain name. Log into your account dashboard and locate the Domain Portfolio, My Domains, or Domain Management section.

Step 3: Locate the DNS or Nameserver Settings

Click on the specific domain name you want to update. Look for a tab or card labeled Nameservers, DNS Settings, or Manage DNS.

Step 4: Switch from Default to Custom Nameservers

Most registrars default to using their own parking or default nameservers.

  1. Select the option that says Custom Nameservers or Use custom nameservers.
  2. Enter your new nameserver hostnames into the provided fields (add a third or fourth field if your provider gave you more).
  3. Save or apply your changes.

Step 5: Verify the Propagation

Once updated, global recursive resolvers need time to notice the change. You can verify that the update is propagating by running an ns lookup or using an online propagation checker.

Comparison: Registrar Nameservers vs. External DNS Providers

Feature Registrar Default NS Dedicated DNS Provider Cloud / CDN NS
Setup Difficulty None (Automatic) Low Medium
Propagation Speed Moderate to Slow Fast Instant (Internal)
Advanced Records Basic (A, CNAME, MX) Advanced (SRV, CAA, TLSA) Security & Edge Rules
DDoS Protection Minimal Standard Enterprise-Grade

Common Mistakes and How to Fix Them

Even experienced engineers occasionally run into configuration snags when updating nameservers. Avoid these frequent pitfalls:

  • Forgetting to copy all records first: When you change nameservers, your domain stops using your old zone file instantly. If you had custom MX records (for email) or TXT records (for SPF/DKIM/DMARC) on the old nameserver, your email and verification checks will break unless you recreate those exact records on the new nameserver before switching.
  • Entering IP addresses instead of hostnames: Nameserver fields require fully qualified domain names (like ns1.example.com), not raw IP addresses (like 192.0.2.1), unless you are configuring glue records for a custom nameserver setup under your own domain.
  • Expecting instant global updates: DNS relies on caching. Even after you update your NS records at your registrar, internet service providers worldwide will continue serving the old cached data until the old TTL expires. This propagation window can take anywhere from 2 to 48 hours.
  • Typos in nameserver spellings: A single character typo in ns1.newhostdns.com will cause total resolution failure for your domain, rendering your website completely unreachable.

Quick Checklist for Nameserver Migration

  • Inventory all existing DNS records (A, CNAME, MX, TXT, SRV) at your current provider.
  • Recreate all necessary records inside your new hosting or DNS control panel.
  • Obtain the exact 2 or more nameserver hostnames from your new provider.
  • Log into your domain registrar and update the NS settings to custom.
  • Verify the update using an ns lookup tool after a few minutes.
  • Monitor email deliverability and web traffic to ensure zero disruption.

Frequently asked questions

What is the difference between an A record and an NS record?

An A record directly points a domain or subdomain to a specific IPv4 address (like 192.0.2.1), telling browsers where the website files live. An NS record points the domain to an authoritative nameserver, telling the internet which server holds the actual collection of A, MX, and TXT records.

How long does it take for nameserver changes to propagate?

Nameserver propagation typically takes anywhere from 2 to 24 hours globally. The exact duration depends on the Time to Live (TTL) set on your previous registrar's root records and how aggressively internet service providers cache DNS queries.

Can I use just one nameserver for my domain?

No, domain registries and internet standards require at least two functional nameservers for redundancy. If one nameserver goes offline or becomes unreachable, the second nameserver ensures your website and email remain accessible.

Why do my old nameservers still show up after I updated them?

If your local computer or your internet service provider has cached the previous DNS lookup results, they will continue displaying the old nameservers until the TTL expires. You can flush your local DNS cache or test using a public resolver to see the updated records.

Do I need to change my nameservers when I change web hosting?

Not necessarily. While many hosting providers require you to use their nameservers, you can also keep your domain pointed to your current DNS provider (or cloud provider) and simply update the A records and MX records to point to your new server's IP address.

Related articles

Free tools