A custom domain gives users a memorable address instead of requiring them to remember a raw server IP or technical hostname.
Connecting a domain normally involves DNS records. The exact record depends on whether you are pointing to an IP address, another hostname or a service that requires a special port.
Understand DNS Records
DNS connects human-readable names to network destinations. The record type you choose depends on whether you are pointing directly to an IP address, another hostname or a service that also needs port information.
Before changing DNS, identify the exact hostname you want to use, such as play.example.com or panel.example.com, and confirm the destination provided by your hosting service.
- A record points a hostname to an IPv4 address.
- AAAA record points to IPv6.
- CNAME points one hostname to another hostname.
- SRV records can describe a service and port for supported applications.
Using an A Record
Use an A record when you want a hostname to resolve directly to an IPv4 address.
The DNS record controls name resolution. The application must still be listening on the correct port and the destination server must accept traffic for that service.
If the server IP changes later, the DNS record must also be updated unless you are using another hostname through CNAME.
play.example.com → 203.0.113.10 DNS Propagation
DNS changes are not always visible everywhere immediately. Resolver caches and TTL values can cause different users to see old and new records for a period of time.
When testing, compare more than one resolver or network before assuming the record is wrong.
Lower TTL values can make future changes propagate faster, but they do not instantly clear records that were already cached.
Websites and HTTPS
A website also needs the web server to recognize the hostname and needs a valid TLS certificate for HTTPS.
A DNS record alone does not automatically configure Nginx, Apache, a reverse proxy or a certificate.
If the domain resolves correctly but the wrong website appears, check the web-server host configuration rather than changing DNS again.
Common Domain Problems
When a domain does not work, separate DNS problems from application problems.
First confirm that the hostname resolves to the expected destination. Then confirm that the service is reachable on the expected port and that any web-server or proxy configuration includes the hostname.
- Record points to the wrong IP.
- Wrong hostname entered.
- Old DNS cached.
- Application listening on another port.
- Web server does not contain the domain.
- TLS certificate does not include the hostname.
A Record, CNAME or SRV?
Use an A record for a direct IPv4 destination. Use CNAME when the hostname should follow another hostname. SRV is useful only for applications that support discovering a service and port through DNS.
Do not use CNAME at the root of a domain unless your DNS provider specifically supports an equivalent feature such as ALIAS or ANAME.
Frequently Asked Questions
How long does DNS take to update?
It varies. Many changes become visible quickly, but cached records can take longer depending on TTL and resolver behavior.
Does an A record include a port?
No. An A record maps a name to an IP address. Port handling is separate.
Why does HTTPS show a certificate error?
The server may not have a TLS certificate that includes the hostname you are using.