The short answer
Nameservers say which company answers DNS questions for your domain; DNS records are the individual answers (where the website is, where email goes). To use new hosting you either change the nameservers to the host’s, or keep your DNS where it is and edit the website records. Build the new site first, because the switch can take up to 48 hours to spread.
Nameservers and records are different things
Nameservers are the servers that hold your domain’s DNS “phone book”. Your registrar stores which nameservers are in charge. DNS records are the entries in that phone book:
- A record: the server address (IP) for your website.
- CNAME: an alias, for example www pointing to the main name.
- MX: where email for the domain is delivered.
- TXT: text notes used for email authentication (SPF, DKIM, DMARC) and ownership checks.
Two ways to point a domain at hosting
Option 1: change the nameservers
You tell the registrar to use the hosting company’s nameservers. From then on the host’s DNS is in charge, and you edit records in the host’s control panel. It is the simplest route when the host will also run your DNS and email. On Goji, the nameservers to use are shown with your hosting account in the dashboard.
Option 2: keep your DNS, edit the records
If your DNS lives somewhere else (the registrar, or a service such as Cloudflare), leave the nameservers alone and change the A record (and www) to the hosting server’s address. This lets you keep other DNS entries, such as email services, exactly as they are.
The safe order
- Set up the new site first. Anything currently running on the domain stops being served from the old place once the change spreads, so the new site must already be working.
- List your current records (especially MX and TXT for email) before touching anything, and copy them to the new DNS if you are changing nameservers.
- Lower the TTL on the records you will change a day beforehand, if your DNS lets you: a low TTL means caches forget the old answer sooner.
- Make the change.
- Check from outside. Look the domain up with an online DNS checker or the
nslookup/digcommand; keep the old site running until you see the new answers everywhere. - Request the SSL certificate once the domain resolves to the new server; see SSL on hosting.
Why it “takes up to 48 hours”
DNS answers are cached around the world for as long as the record’s TTL says. Until each cache expires, some visitors still reach the old server. Usually it is much faster than 48 hours, but nobody can promise a time, so plan for the long end.
Email is the part people forget
If email is delivered by your old host and you change nameservers without recreating the MX records, mail stops arriving. Re-create or move mailboxes before the switch. More in email on your own domain.
Registrar-side help
How to change nameservers at the registrar depends on where the domain is registered. For domains registered through Goji, the registrar side is covered on DomainNepal.com.
Common questions
Will my website be down while nameservers change?
Not if the new site is already set up and the old one stays online until the change has spread. Visitors reach one or the other during the changeover.
Should I use the host’s nameservers or just change the A record?
Use the host’s nameservers if the host will run your DNS and email. Edit the A record instead if your DNS lives elsewhere and you want to keep other entries untouched.