NewHalo Edge 3 is here: HTTP/3 everywhere and 42 edge locations.Learn more
Docs / Domains and DNS

Point a domain name at your VPS

Domains and DNS7 min readUbuntu 24.04 LTS

A domain name is a label that DNS maps to an IP address. To reach your server by name, you add records at your DNS provider that point the name at your server's address. If your domain is managed in Lantern DNS, you can make these changes in the DNS editor.

Before you begin

  • A domain you control, and access to its DNS settings. This guide uses example.com.
  • Your server's public IPv4 and IPv6 addresses. This guide uses 203.0.113.10 and 2001:db8::10 as examples.
  • A web server or other service listening on the server, if you want visitors to see something. You can finish DNS first and install the web server later.

Step 1: Find your server's addresses

Log in to the server and list its network addresses. The -br flags print a brief, one-line-per-interface view:

ip -br addr show
lo               UNKNOWN        127.0.0.1/8 ::1/128
eth0             UP             203.0.113.10/24 2001:db8::10/64 fe80::1/64

Use the public addresses shown on eth0 or your main interface, and ignore 127.0.0.1, which only means "this machine." If your address starts with 10. or 192.168., it is private, and you should use the public address from your control panel instead.

Step 2: Create an A record for IPv4

An A record maps a name to an IPv4 address. In your DNS editor, create a record with these values:

  • Type: A
  • Name: @ (this means the bare domain, example.com)
  • Value: 203.0.113.10
  • TTL: 3600 (one hour; a common default)

Step 3: Create an AAAA record for IPv6

An AAAA record does the same job for IPv6 addresses. Add one with the same name and TTL:

  • Type: AAAA
  • Name: @
  • Value: 2001:db8::10
  • TTL: 3600

Step 4: Add a www record

Many visitors type www in front of the domain, so create one more A record that points there:

Type  Name  Value          TTL
A     @     203.0.113.10   3600
AAAA  @     2001:db8::10   3600
A     www   203.0.113.10   3600

This table shows the finished set of records. Your DNS editor will ask for the same fields in its own layout.

Step 5: Confirm the records resolve

DNS changes can take a while to spread, depending on the TTL. The dig tool asks DNS directly. The +short option prints only the answer. Run these on your computer, or on the server after installing the dnsutils package:

dig +short example.com A
dig +short example.com AAAA
203.0.113.10
2001:db8::10

If the output is blank, wait for the TTL to expire and try again.

Step 6: Test from your computer

Check that the name reaches the server. Ping sends a few test packets to the name:

ping -c 3 example.com

The -c 3 option sends three packets and stops. Replies from 203.0.113.10 mean the name points where you intended. Ping may be blocked by some networks, so do not panic if it fails when dig works.

Tip: Before a planned move to a new server, lower the TTL on your records a day in advance. Changes then spread faster, and you lose less time on the old address.

Troubleshooting

  • The domain still points to an old address. Caches keep old answers until the TTL expires. Wait, then run dig +short example.com A again.
  • Some visitors cannot connect over IPv6. If the AAAA record exists, the server must accept IPv6 traffic. Check that IPV6=yes is set in /etc/default/ufw and that your web ports are allowed. If you cannot configure IPv6, remove the AAAA record.
  • Your registrar's parking page still appears. Remove any default records the provider added to the bare name, so only your A and AAAA records remain for @.
  • Records show up but the site does not load. The address is fine. Check the firewall with sudo ufw status verbose and confirm a web server is running.

Next steps

Your domain now reaches your server. To understand the other record types you may meet along the way, read the DNS record types guide. To serve a separate site under a name such as blog.example.com, see the subdomain guide.

Something not working? Chat or email our support team and we will help you get unstuck.

Contact support