Blog

How to change nameservers for a .pk or .com domain

Ink sketch of two server boxes joined by a curved green arrow.

To change your nameservers, log in to the company where your domain is registered, open the domain’s nameserver setting, replace the old nameservers with the ones your new host gave you, and save. For a .pk domain you registered yourself, you do this in your PKNIC account. The change itself takes a minute. Other DNS servers can keep using the old answer for up to a day on a .pk domain and up to two days on a .com, because those are the time limits the two registries set.

This guide explains what nameservers are, what moves when you change them, the steps for .com and .pk domains, how long the switch takes and how to check it yourself instead of waiting.

What are nameservers?

Nameservers are the DNS servers that hold your domain’s records. When someone types your address, their device asks a chain of DNS servers where to go. The last link in that chain is your nameservers, which answer with the records you set up:

  • an A record, the address of the server that runs your website
  • MX records, the servers that receive your email
  • TXT records, which carry email security settings and ownership checks for services such as search consoles

One step earlier in the chain sits the registry for your domain ending. For DNS, it keeps only the names of your nameservers. For .pk that registry is PKNIC, and for .com it is VeriSign, according to the IANA root zone database. When you change nameservers, you change that one pointer at the registry, through the company you registered with.

If the difference between the domain and the server is still unclear, read our guide to how a domain differs from hosting first.

What changes when you change nameservers?

Everything in the list above moves at once. After the switch, the internet reads all your records from the new nameservers, and the records at the old ones stop counting.

That is fine for the website, because your new host adds an A record for it. Email is where people get caught. If your email runs somewhere other than your new host, the new nameservers need that email provider’s MX and TXT records before you switch. Otherwise mail stops arriving as soon as the change spreads, and nothing warns you except silence.

So before you change anything, open the DNS settings at your current provider and copy every record into a text file. That list is your checklist for the new provider.

How do you find where your domain is registered?

You change nameservers at the registrar, the company that sold you the domain. That is not always your host. If you are unsure which company it is:

  • For a .com, type the domain into ICANN Lookup, ICANN’s registration data tool. It shows the registrar’s name and the current nameservers.
  • For a .pk, use the WHOIS search on PKNIC’s home page. If you registered the domain yourself, it is in your own PKNIC account. If a reseller or a web designer registered it, they hold the account.

If a designer or a relative registered your .pk domain in their account, ask them to make the change, or to move the domain to your own account. Our guide to registering a .pk domain explains how that move works and why the registrant name matters.

How do you change nameservers for a .com domain?

Every registrar’s screen looks different, but the steps are the same:

  1. Log in to your account at the registrar.
  2. Open the domain’s settings. Look for a section called Nameservers, DNS or Manage DNS.
  3. Choose the option for custom nameservers.
  4. Delete the old nameservers and type in the new ones, exactly as your host wrote them. Remove any old nameserver you do not replace, so only the new ones are left.
  5. Save, and wait for the confirmation message.

How do you change nameservers for a .pk domain?

It depends on who holds the domain:

  • You registered it with PKNIC yourself. Log in to your PKNIC account and open My Domains, then Manage Domains. Open the domain and change its nameservers there.
  • A reseller registered it. Use the reseller’s control panel, or open a ticket with the reseller and give them the new nameserver names.

The registrant details on a .pk domain are locked, and changing them takes documents by post. Nameservers are a separate setting, and PKNIC’s rules say a domain does not even need nameservers when you register it. So you can register a .pk name first and connect it to hosting later.

After you save, PKNIC has to publish the change. Its FAQ says the .pk zone files are pushed out “every few hours”, and that PKNIC cannot control how fast other servers on the internet pick up the change.

How long does a nameserver change take?

We checked where the familiar “up to 48 hours” comes from by asking the registries’ own servers. Each DNS answer carries a time to live, the number of seconds other DNS servers may keep a copy before they must ask again. Here is what the registries returned for a domain’s nameserver records:

  • .com. VeriSign’s .com servers gave a time to live of 172,800 seconds, which is 48 hours.
  • .pk. PKNIC’s .pk servers gave 86,400 seconds, which is 24 hours.

So a DNS server at an internet provider that saved your old nameservers just before you made the change may keep using them for up to two days on a .com and up to one day on a .pk. On a .pk domain, add the wait for PKNIC’s next zone update.

Those are upper limits, not the time every visitor sees. When we asked Google Public DNS for the same .pk domain, it reported that it would keep the answer for 21,600 seconds, which is six hours. So many visitors may see the new site within hours, while a few see the old one for a day or two. You cannot make other servers drop their saved copies early, so keep the old hosting running until the switch is complete.

How do you check whether the change has worked?

Do not keep refreshing your website, because your own device and internet provider may hold the old answer. Ask the servers directly instead.

Ask the registry

Windows has a tool called nslookup built in. Open Command Prompt and type one of these, with your own domain:

nslookup -type=ns yourdomain.pk root-c1.pknic.pk
nslookup -type=ns yourdomain.com a.gtld-servers.net

The first asks one of PKNIC’s own .pk servers which nameservers it has for your domain. The second asks one of VeriSign’s .com servers. We ran both on a Windows laptop. Each one printed a few extra lines first, such as a timeout message or a list of other servers, and the nameserver lines came at the end.

If the registry shows your new nameservers, your part is done. If it still shows the old ones, the change has not been saved, or on a .pk domain, PKNIC has not published it yet.

Ask a public DNS service

Next, open Google Public DNS in your browser, type your domain, and choose NS as the record type. Then try A for the website and MX for email.

If the registry shows the new nameservers but a public DNS service shows the old ones, you are only waiting for a saved copy to run out. If both show the new nameservers and the website still looks wrong, the problem is in the records at your new host, not in the nameserver change.

Should you change nameservers or only the A record?

You have two ways to connect a domain to new hosting:

  • Change the nameservers. Your new host then runs all your DNS records in its control panel, including email records. This is the usual choice when the website and the email both live with the new host.
  • Keep your nameservers and change the A record. Ask the new host for the server’s IP address, and point the A record at it in your current DNS. Your email records stay exactly as they are. This suits you if your email or other services already run from DNS you do not want to move.

Webstribe’s own help guide on pointing your domain to your hosting covers both ways, with the nameserver names to use.

What mistakes should you avoid?

  • Changing them in the wrong place. If your DNS runs at a separate service, editing records at the registrar does nothing until the nameservers point back there. Check which nameservers are active first.
  • Leaving an old nameserver in the list. A mix of old and new nameservers sends some visitors to each. Keep only the new set.
  • A typing mistake. One wrong letter in a nameserver name takes the site and email offline. Copy and paste from your host’s email.
  • Forgetting email. Copy the MX and TXT records to the new host before you switch, as described above.
  • Cancelling the old hosting too early. Wait until the registry and public DNS both show the new nameservers, and you have checked email, before you cancel. Our guide to moving a WordPress site to a new host covers the full order of steps.
  • Letting the domain expire. An expired domain stops working whatever its nameservers say. Check the expiry date while you are logged in.

Frequently asked questions

What are nameservers in simple words?

They are the servers that hold your domain’s settings, such as where the website is and where email should go. The registry for your domain ending points to them, and everyone else reads your settings from them.

How long does a .pk nameserver change take?

PKNIC says it publishes zone changes every few hours. After that, other DNS servers may keep the old answer for up to 24 hours, the time limit we saw on PKNIC’s own servers. Many visitors see the change sooner.

Will changing nameservers stop my email?

It can. Your email records move with the nameservers. Add your email provider’s MX and TXT records at the new host before you switch, and email keeps working.

Do I have to change nameservers when I move to a new host?

No. You can keep your current DNS and only point the A record at the new server’s IP address. Changing nameservers is simpler when the website and email both move to the new host.

How can I see my domain’s current nameservers?

Run nslookup -type=ns yourdomain.com in Command Prompt, or look the domain up on Google Public DNS with the NS record type. ICANN Lookup also shows them for a .com domain.

Category:

Written by

Muhammad Dilawar

Muhammad Dilawar

Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing and maintaining websites. He works with WordPress, WooCommerce, server optimization, DNS, SSL, Cloudflare, website security and performance, and is a Top Rated freelancer on Upwork.

Hosting for your WordPress site

Yearly plans in rupees, with the same price at renewal. Free SSL and daily backups on every plan.