How to point a domain name at your server
To point a domain name at your server, you add an A record that shows your server's IP address on the DNS screen of the place where you registered the domain. Adding the record takes a minute. How soon it is visible across the internet depends on caches. It usually takes minutes, and sometimes a few hours.
Step by step
- Get your server's IP address. In the Seturack panel, open My servers, click your server and look at the IP Address row on the Overview tab.
- Open the DNS screen at the place where you bought the domain or where you manage its DNS. It is usually called "DNS management" or "DNS records". Before you change anything, take a screenshot of the existing records so you can go back if needed.
- Add an A record for the root domain: name
@, typeA, value the server's IP address. - Add a record for
wwwtoo: either an A record with the same IP, or a CNAME record fromwwwto the root domain. - Delete old A and AAAA records and any "parked page" records. If you leave several different A records for the same name, visitors are sent to a random one of them.
- Wait, and check with the commands below.
Record types
| Type | What it does |
|---|---|
| A | Points a name at an IPv4 address. This is the record your server needs. |
| AAAA | Points a name at an IPv6 address. If your server has no IPv6 address, don't add this record, and delete an old AAAA record if there is one. |
| CNAME | Redirects a name to another name, for example www to the root domain. It can't exist next to another record on the same name, so it is normally not used on the root domain (@). |
| MX | Says which server email is delivered to. When you move a site, don't touch your email records. |
| TXT | Used for verification and for text records such as SPF and DKIM. |
Propagation time and how to check
TTL says how many seconds a record is kept in a cache. What we call "DNS propagation" is really the caches around the world forgetting the old record. When you add a new record, it is often quick. When you change an existing record, you may wait as long as the old record's TTL. If you will move a live site, lower the TTL to a small value such as 300 seconds at least one TTL period before the move, and return it to its old value when the switch is done. If a name that never existed was queried before, the "does not exist" answer can also stay in caches for a short time.
Check that the record is visible with these commands:
- macOS and Linux:
dig +short example.comshould print your server's IP address. Forwww, trydig +short www.example.com. - Windows:
nslookup example.com - If your browser still goes to the old address, clear your computer's DNS cache. On Windows run
ipconfig /flushdns. On macOS runsudo dscacheutil -flushcacheand thensudo killall -HUP mDNSResponder.
If the command prints the right IP but the page doesn't open, run curl -I http://example.com to see whether the server answers. If an answer comes back but the content isn't the site you expect, the web server doesn't know this domain. You also need to introduce the domain to the web server.
How do you point a subdomain?
For a subdomain (for example blog.example.com), you add the same kind of record: name blog, type A, value the server's IP address. Every subdomain is a separate record. If you send them all to the same server, write an A record for each one, or write an A record once and point the others to it with CNAME records. The web server decides which site opens.
Adding a record or changing nameservers?
In most cases adding a single A record is enough, and DNS management stays where it is. Changing the nameservers means handing DNS management to another provider. If you do that, you must recreate all records, especially the MX records, at the new place. Do it only on purpose.
Common mistakes
- Adding a record only for the root domain.
www.example.comis a separate name and needs its own record. - Leaving an old AAAA record. If the IPv6 record points to another server, some visitors end up in the wrong place.
- Adding the record in the wrong place. If you have pointed the nameservers to another provider, you manage the records where those nameservers point, not where you bought the domain.
- Typing a prefix in the value field. Don't write
http://in the value of an A record. Write only the IP address. - Trusting the browser. A browser cache can mislead you. Check with a command first.
After you point the domain
Once the domain reaches the server, you need to tell the web server about the domain and get an HTTPS certificate. Let's Encrypt issues free certificates. On Seturack's web-based ready-made apps, such as WordPress, you also tell the app about the domain, for example by writing it in the Caddy settings and in WordPress's address fields. The steps for each app are in this help article.
You don't need a separate IP for every domain. You can host several domains on the same IP address, and the web server serves the right site by looking at the domain name in the request. If you want a separate IP, you can add an extra IP. An extra IP costs about $1 a month, VAT included. On Linux servers the IP is added inside the server automatically.
Seturack doesn't sell domain names, so you buy your domain somewhere else. The only thing you need from the panel is your server's IP address. You add the DNS record where you manage the domain.
Comments0
No Comments Yet
Be the first to share your thoughts.
Please sign in or sign up to leave a comment.