What Are A Records?¶
A records are a type of DNS record that points your domain name to a static IPV4 address.
When do I use an A record?¶
A records are ideal for pointing your domain (or subdomain) at a server that has a static IPV4 address. To point to an IPV6 address you would need to use an AAAA record.
This type of record, along with the AAAA record, is the most common way to point your domain to a server where your website is hosted.
Can I have an example of an A record?¶
Here is a model that you can follow. You will replace 220.127.116.11 with your IP address.
@ 10800 IN A 18.104.22.168
This record points your bare domain (such as example.com, without any subdomain) towards an IPV4 address. This is the most common use for an A record.
How can I use an A record for a subdomain?¶
For subdomains, in most cases using a CNAME record instead of an A record will simplify management of your domain. If your IP address changes you will need to update every A record with the new IP address, but by using CNAME records you will only need to update the single core A record.
For cases where an A record is preferred, you can point a particular subdomain to an IPV4 address follow this pattern:
www 10800 IN A 22.214.171.124
This records points only the subdomain www, so visits to www.example.com will go to this IP address.
You can also use web forwarding to forward a subdomain to your main site.
What are wildcard A records?¶
It is also technically possible to create a wildcard A record:
* 10800 IN A 126.96.36.199
This will point any unassigned subdomains to the IP address listed. It will not override other records for specific subdomains, but it will allow a visitor to reach the given IP address by by typing any other combination of letters or words as a subdomain. However, creating a wildcard A record has some potential downfalls.
First, not all situations will support wildcard A records. A wildcard A record will only work if the server and your extension both support this kind of record.
Second, since any possible subdomain will go to your main site, it makes it possible for someone to use an unflattering subdomain as a valid link to your site, such as thisisabadexample.example.com.
Also, as mentioned above, every A record will need to be updated every time the IP address changes.