Support >
  About cybersecurity >
  DNS Resolution and Subdomain Binding Tutorial: Principles, Operations, and Precautions

DNS Resolution and Subdomain Binding Tutorial: Principles, Operations, and Precautions

Time : 2026-02-18 15:02:51
Edit : DNS.COM

  Subdomains are a common practice in website operation and domain management, serving different business modules, independent websites, or functional services. For example, blog.example.com can be used for a blog, and shop.example.com for an online store. Subdomains allow for flexible division of site functions and independent management of DNS records. For novice website owners, binding subdomains can be confusing: How to configure them in DNS? What is the difference between an A record and a CNAME record? How long does DNS resolution take effect?

  A Brief Explanation of DNS Resolution Principles:

  Understanding DNS resolution principles before binding subdomains helps in quickly troubleshooting.

  When a user accesses a subdomain, such as blog.example.com, the browser queries its local DNS cache. If the subdomain doesn't exist, it queries the parent DNS server. The recursive DNS server queries the main domain's DNS records to obtain the IP address corresponding to the record (A record or CNAME). The browser then sends a request to the resolved IP address to complete the access.

  In short, access to subdomains requires correctly configured DNS records; otherwise, access will be impossible.

  Second-level domain name DNS record types and selection:

  Common DNS record types include:

  1. A record:

  Purpose: Resolves the domain name directly to the server's IPv4 address.

  Applicable scenarios: You have a fixed server IP address and need to directly bind the second-level domain.

  Explanation: When a user accesses blog.example.com, it will directly resolve to IP 192.168.1.100.

  2. CNAME record

  Purpose: Points the second-level domain name to another domain name, achieving alias resolution.

  Applicable scenarios: You don't want to bind a fixed IP address, or multiple domain names point to the same main domain.

  Explanation: blog.example.com actually accesses the server of www.example.com, and the DNS resolution updates with the main domain.

  3. MX, TXT, AAAA, etc. records

  MX records are used for mail servers, TXT records are used for SPF/DKIM authentication, and AAAA records are used for IPv6. When binding a second-level domain, usually only A or CNAME records need to be configured; other records are configured according to business needs.

  Steps to bind a subdomain:

  1. Log in to your domain registrar or DNS service provider's backend, go to DNS management, select the target domain, and open "DNS Settings" or "DNS Management".

  2. Add a DNS record. Click "Add Record," fill in the host record information, select the record type (A or CNAME), fill in the record value (IP or main domain), set the TTL (600 seconds recommended or use the default value), save and apply the changes.

  3. Wait for the DNS changes to take effect. DNS changes typically take anywhere from 5 minutes to 24 hours (depending on the TTL). You can use a command to test if the DNS changes are effective. If the correct IP or domain name is returned, the DNS changes are successful.

  4. Configure the server or virtual host. On the server side, the subdomain needs to be bound to the corresponding website directory. After configuration, restart Nginx.

  FAQs:

  1. Subdomain inaccessibility: Check if the DNS records are correct? Check if the TTL is effective? Confirm that the server firewall or security group allows access?

  2. A record and CNAME conflict: The same subdomain cannot have both A and CNAME records simultaneously. Choose only one record to avoid resolution conflicts.

  3. Multi-level domain name resolution: If third- or fourth-level domains need to be configured using A or CNAME, pay attention to the hierarchical relationship and host record entry rules.

  4. HTTPS configuration: Subdomains require separate SSL certificates, or use wildcard certificates to cover all subdomains. After configuration, ensure normal HTTPS access.

  5. Slow DNS resolution effect: DNS caching may cause inaccessibility for a short period after modification. Clear the local DNS cache.

  Summary: Binding subdomains is an important means of splitting website business, making services independent, and flexibly managing them. By properly configuring subdomain resolution, even novice webmasters can achieve independent deployment of multiple business modules on their website, improving management flexibility and access stability.

DNS Amy
DNS Becky
DNS Luna
DNS NOC
Title
Email Address
Type
Information
Code
Submit