Each subdomain has its own DNS record and points to a different IP address than the main domain. The choice of DNS record—be it CNAME, A record, or DMARC—depends on where you want the DNS to point to or if you want the DNS in the same server or not.
This article explores the distinctions between CNAME, A records, and DMARC records for subdomains, covers various subdomain types, and guides on creating a subdomain in GoDaddy.
- Every subdomain needs a DNS record, and you can choose from different DNS record types
- “A” records point to static IP addresses
- CNAME records point to domains or subdomains
- DMARC records are used to protect email servers from cyberattacks
- Continue reading to learn how DNS works with subdomains and which one you should choose
How Does DNS Work with Subdomains?
The Domain Name System (DNS) translates domain names to numerical IP addresses, enabling the identification of the computer location. Upon entering a website, your device queries DNS servers for the corresponding IP, facilitating access.
Subdomains link to the same server as the primary domain name or link to a different server in another DNS zone. You can consolidate or distribute DNS records to direct traffic.
Do Subdomains Have Separate DNS?
Yes, each subdomain has its own DNS record and environment separated from the primary domain. You can assign a server to each subdomain, which allows for independent DNS management.
By doing this, you gain flexibility in configuring and managing the DNS settings for specific sections of a domain. It also allows you to optimize and organize your website, even attaining complex DNS configurations.
Why Do Subdomains Need DNS?
DNS enables proper routing and addressing of websites on the internet. DNS translates domain names into IP addresses, and it does the same with subdomains, so servers can locate and serve content to specific subdomains.
A DNS facilitates the hierarchical structure of the internet by resolving the subdomain addresses to their assigned servers. Ultimately, it results in more direct access to the services or content in each subdomain.
What DNS Records Are Needed for a Subdomain?
There are several types of DNS records. Here are the most popular:
CNAME Records for Subdomains
A Canonical Name or CNAME record connects one domain name to another. It is often used when you want one domain or subdomain to point to the same location as another domain.
In essence, it acts as an alias for another domain.
CNAME records are commonly used for pointing subdomains to third-party services like content delivery networks or hosted platforms, allowing for website URL redirection, and ensuring that multiple domain names resolve to the same location.
DNS “A” Records for Subdomains
A record is a type of DNS record that points a domain or subdomain to a server with a static IPV4 address. For instance, an A record can point to the site example.com which has the IPV4 address 184.108.40.206
Sometimes you need to use an A record instead of a CNAME for a subdomain. In this case, you can point a particular subdomain to an IPV4 address with the following pattern:
Records are not suitable for dynamic IPs. When the IP address changes, you need to update the A record with the new IP address.
What Is the Difference between a DNS “A” Record and a Subdomain?
Subdomains are a section of a website, in a prefix before the primary name. A subdomain can use an A record, CNAME or other records for its DNS setup.
DMARC Records for Subdomain
DMARC stands for Domain-based Message Authentication, Reporting, and Conformance policy. It is a DNS record that instructs the receiving mail server what to do with a message that doesn’t align or authenticate with DKIM and other email protocols.
Here’s an example of the DMARC structure:
The DMARC policy set for the primary domain applies to the subdomains. But if you want to set a specific policy for a subdomain, you should use a sp record for the subdomain.
Do I Need a DMARC Record for Each Subdomain?
No, by default, a DMARC policy set for a main domain applies to all subdomains. However, if the DMARC record was set for a specific subdomain, it only applies to it.
Wildcard DNS Records for Subdomains
A DNS subdomain wildcard matches requests for subdomains yet to exist. It is specified by using an * as the prefix for the subdomain. *.example.com. However, a wildcard DNS record won’t cover a root domain.
Can DNS Records of Subdomains Point to Different IPs?
Yes. You can modify a subdomain as an A record pointing to a static IP address. You can use a CNAME to redirect the DNS to another domain name.
If you want to know more about how to manage site DNS, check our guide Managing DNS for Websites.
How to Create a DNS Record for Subdomain on GoDaddy
Here are the step-by-step instructions for adding subdomain DNS records on GoDaddy.
Step 1: Log into your GoDaddy account.
Step 2: Go to your GoDaddy Domain Portfolio and locate the domain you want to edit.
Step 3: Click on the three-dot menu on the side. Look for the Domain Edit Options and select Edit DNS
Image source: GoDaddy.com
Step 3: Click on add new record
Image Source: GoDaddy.com
Step 4: Click on A from the “Type” menu
Step 5: Type the details for the new A record subdomain. The Name is the prefix of the record, for example, store or blog. The Value is the IP address you want the record to point to. You can add more IP addresses to this record by selecting Add another value.
Step 6: Click Save to add the new record.
Final Word: Which Type of DNS Record Should You Use?
There are several options for DNS setup. You can opt for an A record to simplify address connections, or you can use a CNAME to point to another domain or subdomain. It can also depend on your hosting provider. Ultimately, the best answers will depend on what goal you want from the domain’s subdomain
You can learn more about web hosting in our Best Web Hosting guide.
Next Steps: What Now?
- If you haven’t already, choose a hosting provider that aligns with your website’s needs and budget
- Choose and add subdomains using your hosting provider
- Select the DNS record type you will use
- Set up your website
- Optimize it for search engines
Learn More About SubdomainsHow to Create a Subdomain for a Primary Domain: Comprehensive GuideHow to Create a Subdomain in GoDaddy with and without cPanelWhat Is a Subdomain: Everything You Need to KnowSubdomain vs Subdirectory: Which is Better for SEO?Domain vs Subdomain: What They Are and What’s the Difference?How to Find All Subdomains of a Domain with Free Online ToolsWildcard Subdomains: What They Are & How To Set Them UpHow To Redirect a Subdomain to Url: A Complete GuideSEO for Subdomains: Benefits, Disadvantages & Strategies for SuccessEmail Subdomain: What It Is & How to Use ItSSL Certificate for Subdomain: How to Pick and Install the Right One?How to Create a Subdomain in cPanel: Step-by-Step GuideSubdomain Delegation to Another DNS Service Provider: Complete GuideNGINX Subdomain Tutorial and Setup GuideHow to Create a Subdomain in Namecheap HostingSubdomain Takeover: What It Is and How to Prevent ItSPF Record for Subdomain: What Is It & How It Works?