Skip to content
Horanos

Domains

How do I connect my domain to my hosting?

Two ways to point a domain at a server: name servers or an A record. When to choose which, how long the change takes, and how to check it worked.

2 min read

Illustration of the two ways to connect a domain to a hosting server: nameservers (NS) or an A record

A domain is a name, hosting is a place. Connecting them means telling the internet: “when someone types this name, go to this server”. That happens in the domain's DNS settings, not in the hosting itself.

Way one: change the name servers

Name servers answer every question about your domain: where the site is, where the mail goes. When you set your hosting company's name servers, it manages all of that for you.

  1. 01Find the two name servers in the hosting welcome e-mail or the control panel. They usually look like ns1.example.com and ns2.example.com.
  2. 02Open the domain settings where the domain was registered and look for “Name Servers”.
  3. 03Remove the old values, enter the new ones and save.

Way two: an A record

To keep your name servers as they are, add an A record pointing to the server's IP address. You usually need two: one for the domain itself (@) and one for www, or a CNAME for www pointing to the domain.

  • Type A, name @, value: the server's IP address.
  • Type CNAME, name www, value: your domain name.

This suits anyone who runs DNS in one place and splits services: the website here, the mail there.

How long does the change take?

Servers around the world keep old answers for as long as each record allows (its TTL). So some people see the change within minutes, others after hours. A name server change can take up to two days at worst.

How do I check it worked?

  • Check the domain with the free “Domain and mail check” tool: it shows the current name servers, the IP address the domain points to and the mail records.
  • If the new servers show but the old site still opens for you, clear the browser cache or try from your phone's network.
  • Once the site works, check its SSL certificate: many hosts issue it automatically after the domain points to them.

Common mistakes

  • Entering only one name server: at least two are required.
  • Forgetting the www record: example.com works, www.example.com does not.
  • Changing name servers without moving the mail records: e-mail stops without warning.

Was this article helpful?

Read next

Knowledge base