Support >
  About cybersecurity >
  What do the @ symbol and www represent in host records? Explanation of domain name resolution parameters.

What do the @ symbol and www represent in host records? Explanation of domain name resolution parameters.

Time : 2026-07-24 10:28:48
Edit : DNS.COM

  In the domain name resolution control panel, you'll inevitably encounter an input box called "Host Record" or "Hostname." Some people fill in "@", some fill in "www", and some leave it blank. What's the difference between these three methods? What are the consequences of filling it in incorrectly? Many people, when adding DNS records, are completely unaware of the meaning of these symbols and prefixes, simply copying screenshots from others, resulting in their websites either being inaccessible or opening onto other websites. This article will thoroughly explain the rules for the "@" symbol, "www", and the Host Record field.

  What is a Host Record for?

  Before we begin, let's clarify a basic concept: domain names have a hierarchical structure.

  The complete domain name www.example.com., viewed from right to left:

  The dot (.) is the root domain (top level, usually omitted)

  The ".com" is the top-level domain

  "example" is the second-level domain (also called the main domain)

  "www" is the third-level domain (usually called a subdomain or hostname)

  The "Host Record" is the leftmost level, which is the prefix of the subdomain. It determines which specific subdomain this DNS record applies to.

  For example: If your main domain is example.com, then:

  Host record with www → This record applies to www.example.com

  Host record with @ → This record applies to example.com itself (i.e., without any prefix)

  Host record with → This record applies to all subdomains that are not explicitly specified, such as abc.example.com, xyz.example.com

  Host record with mail → This record applies to mail.example.com

  Host record with api → This record applies to api.example.com

  Understanding this, everything else follows logically.

  @ symbol: Represents the main domain itself

  @ is a special reserved symbol in DNS resolution; it represents the "main domain" itself, that is, the bare domain without any prefix.

  When you enter the @ symbol in the host record field, you are actually telling the DNS system: this record will apply to the domain name example.com, not www.example.com, nor abc.example.com, but the original example.com.

  For example: If you have a website and want users to be able to access it by entering example.com, you need to add an A record with the @ symbol pointing to your server's IP address.

  Host Record: @

  Record Type: A

  Record Value: 192.0.2.1

  This way, when a user enters example.com in their browser, the DNS will resolve it to 192.0.2.1.

  Note that the usage of the @ symbol varies slightly among different DNS providers:

  Alibaba Cloud/Tencent Cloud/Cloudflare: Enter @ directly in the host record field; the system recognizes it as a raw domain name.

  Some older DNS management systems: may require leaving the host record blank, or using a period (.) to represent the main domain name. If you are unsure, you can check the prompts in the control panel. Additionally, the @ symbol can only exist once per record type. For example, you cannot add two A records with @ pointing to different IPs simultaneously (unless you are doing load balancing, which requires multiple records with weights, and most DNS servers do not support this). Similarly, MX records and TXT records can also use @ to apply to the main domain itself.

  www: Just a subdomain

  www itself has no special meaning; it's just a regular subdomain prefix, exactly the same as naming your domain mail, api, or blog.

  That's right, www is not required, nor is it a special reserved word. It was simply a common prefix widely used in the early days of the internet to identify a web service. However, today, many websites no longer use the www prefix and are accessed directly using the bare domain name.

  But www and @ have a key difference: the scope of cookies.

  If you log in to a website using example.com, the browser's cookies will apply to example.com and all subdomains (including www.example.com) by default. However, if you log in using www.example.com, the cookie will only apply to the www.example.com subdomain by default, and will not be sent to api.example.com or example.com.

  This is why many websites use 301 redirects: either permanently redirecting example.com to www.example.com, or vice versa. The goal is to unify all traffic to a single domain, avoiding cookie conflicts and also improving SEO ranking.

  In the DNS configuration, @ and www are two separate records, which need to be added separately:

  Record 1:

  Host record: @

  Record type: A

  Record value: 192.0.2.1

  Record 2:

  Host record: www

  Record type: A

  Record value: 192.0.2.1

  Both records point to the same IP address, so whether a user enters example.com or www.example.com, they can access your website. Whether or not to implement 301 redirects at the web server level is a matter for later consideration.

  Other Common Host Record Formats

  Astronomy (Wildcard DNS)

  Using an asterisk () in the host record indicates wildcard DNS, meaning all subdomains not explicitly specified point to the same target.

  For example, if you set .example.com to point to 192.0.2.1, then:

  anything.example.com → 192.0.2.1

  test.example.com → 192.0.2.1

  random123.example.com → 192.0.2.1

  However, if www.example.com already has a separate A record, that record will be used, and wildcard DNS will not be used.

  Typical application scenarios for wildcard DNS: multi-user blog platforms (each user is assigned a subdomain), multi-tenant routing in SaaS services, or situations where you don't want to add a separate record for each subdomain.

  Note: Wildcard DNS should not be confused with @. @ only applies to the bare domain, while applies to all subdomains; their scopes differ.

  Left Blank (Empty Hostname)

  In some DNS systems, leaving it blank is equivalent to `@`, representing the main domain. However, this isn't a universal standard; some systems will throw an error if it's blank, while others will treat it as invalid input. The safest approach is to explicitly use `@`, rather than relying on the implicit rule that "blank equals bare domain".

  Pure Numbers or Letters (Custom Subdomain)

  Host records can contain any combination of letters, numbers, and hyphens, as long as they conform to domain name naming conventions and are no longer than 63 characters. For example, `mail`, `ftp`, `blog`, `api-v2`, and `test-2026` are all valid.

  Each such host record creates a corresponding subdomain, which resolves independently and does not affect others.

  Special Behavior of Host Records in Different Record Types

  In CNAME records, the host record cannot be `@`.

  This is a common pitfall for beginners. CNAME rules state that if another record (especially SOA and NS) already uses this hostname, a CNAME record cannot be added to it. Naked domains (@) typically already have SOA and NS records, so most DNS providers prohibit setting CNAME records on the @ symbol.

  Solution: If you want example.com to point to another domain (such as a CDN domain), you need to check if your DNS provider supports ALIAS or ANAME records. These two records can achieve similar functionality to CNAME records but can be used on naked domains. Cloudflare has CNAME Flattening technology, and Alibaba Cloud has "Explicit URL Forwarding" to circumvent this restriction; the specific method depends on your provider.

  In MX records, @ and subdomains have completely different meanings.

  If you set an MX record on @, it means that emails received by the @example.com domain are processed by a specific mail server.

  If you set an MX record on mail, it means that emails received by the mail.example.com subdomain are processed by a specific mail server—these are two completely different things.

  Most enterprise email configurations use the @ symbol for MX records because you want to receive emails with the @example.com suffix, not @mail.example.com. Host records and URL forwarding are two different things.

  This is the most common point of confusion. Host records in DNS resolution configure DNS-level mapping, only responsible for converting domain names to IP addresses. URL forwarding (also called explicit or implicit forwarding) is an HTTP-level behavior, implemented by the web server or CDN node responding with a 301/302 redirect.

  For example:

  You add an A record in your DNS for www.example.com pointing to 192.0.2.1, and then configure Nginx on your server to redirect www.example.com to example.com.

  These two actions have different functions and are both essential. DNS is responsible for allowing users to find your server, while Nginx/the web server is responsible for redirecting users from www to the raw domain name.

  If you only set a CNAME record in your DNS to point www.example.com to example.com, but don't configure any redirection on the server, the user's browser address bar will still show www.example.com; no redirection has occurred. The CNAME record simply makes both domain names resolve to the same IP address; the URL itself remains unchanged.

DNS Anna
DNS Jade
DNS Amy
DNS NOC
Title
Email Address
Type
Information
Code
Submit