BIND Zone CNAME Generator

Generate BIND zone CNAME records from CSV

Alias Mappings

Format

Each line: alias, target

Target should be a FQDN (ending with a dot)

BIND CNAME Records

Enter alias mappings to generate CNAME records

The BIND Zone CNAME Generator creates properly formatted DNS zone file entries for CNAME (Canonical Name) records from CSV or tabular input. Provide alias-target pairs like www,webserver.example.com. and blog,www, and the tool produces BIND-compatible zone file entries with validation for common CNAME pitfalls like apex placement and conflicting record types.

Understanding DNS CNAME Records

A CNAME record is a DNS alias. It tells resolvers that one hostname is really just another name for a different hostname. When a resolver looks up www.example.com and finds a CNAME pointing to webserver.example.com, it transparently restarts the lookup using the target name and returns the final IP address to the client. The client never knows a CNAME was involved. This indirection is what makes CNAMEs so useful: you can create a friendly name like www that points to whatever the actual server hostname is, and if you move to a different server, you only update the CNAME target rather than updating every reference to the old hostname.

CNAMEs are particularly valuable for cloud services where the actual hostname is something unwieldy like d1234abcdef.cloudfront.net or my-app-lb-1234567890.us-east-1.elb.amazonaws.com. You create a CNAME from cdn.example.com to the CloudFront distribution or from app.example.com to the ELB endpoint, giving your users a clean name while letting the cloud provider manage the underlying infrastructure. If the provider changes their hostname, you update one CNAME record instead of reconfiguring every client.

However, CNAMEs come with important restrictions that trip up even experienced administrators. A CNAME cannot coexist with any other record type at the same name, which means you cannot have a CNAME and an MX record for mail.example.com. More critically, you cannot place a CNAME at the zone apex (example.com itself) because the apex must have SOA and NS records. This generator validates your input against these rules and warns you before they cause problems in production.

How to Generate BIND CNAME Records

  1. Enter your data as CSV with columns for the alias name and target hostname (optionally include TTL)
  2. The tool validates that alias names follow RFC 1123 rules and targets are valid hostnames
  3. It checks for common CNAME violations like apex placement and conflicting record types
  4. Copy the generated zone file entries for direct use in your BIND zone configuration

CSV Input and Zone File Output Examples

Input CSV

www,webserver.example.com.
blog,www
docs,docs-app.cdn.provider.net.
staging,staging-lb.us-east-1.elb.amazonaws.com.
ftp,files

Generated Zone File Output

www       IN  CNAME  webserver.example.com.
blog      IN  CNAME  www
docs      IN  CNAME  docs-app.cdn.provider.net.
staging   IN  CNAME  staging-lb.us-east-1.elb.amazonaws.com.
ftp       IN  CNAME  files

CNAME Record Examples

Alias (Name)Target (Canonical)Use Case
wwwwebserver.example.com.Point www to canonical server name
blogexample.blog-platform.com.Alias to hosted blog service
cdnd1234.cloudfront.net.Point to CloudFront distribution
mailmail.google.com. (invalid)Cannot CNAME a name that has MX records
shopshops.myshopify.com.Alias to e-commerce platform
statusexample.statuspage.io.Point to status page service

When to Use This Tool

  • CDN integration -- Creating CNAME aliases that point to CDN provider hostnames like CloudFront, Cloudflare, or Akamai
  • Cloud service endpoints -- Mapping friendly names to load balancer DNS names from AWS ELB, Azure, or GCP
  • Service migrations -- Maintaining old hostnames as CNAME aliases to new canonical names during transitions
  • Multi-environment deployments -- Creating environment-specific aliases like staging.example.com pointing to infrastructure hostnames
  • Vanity domains -- Pointing marketing or campaign subdomains to hosted platform endpoints
  • Internal DNS organization -- Creating readable aliases for complex infrastructure hostnames

How DNS CNAME Resolution Works

A CNAME record tells DNS resolvers that one name is an alias for another (the canonical name). When a resolver encounters a CNAME, it restarts the lookup using the target name instead.

Resolution Chain

When a client queries www.example.com and finds a CNAME:

Query: www.example.com A
  -> CNAME: webserver.example.com
    -> A: 203.0.113.10

Result: www.example.com -> 203.0.113.10

The resolver follows the CNAME chain transparently. Clients see the final A or AAAA record without knowing about the intermediate CNAME.

CNAME Restrictions

CNAME records have important restrictions that the generator enforces:

  • No CNAME at the zone apex: A CNAME record cannot exist at the zone apex (e.g., example.com itself). The apex must have SOA and NS records, and CNAME cannot coexist with any other record type for the same name. Use an A/AAAA record or a provider-specific ALIAS/ANAME record at the apex instead.

  • No other records alongside CNAME: If a name has a CNAME record, it cannot also have A, AAAA, MX, TXT, or any other record type. This is a common source of DNS configuration errors.

  • CNAME chains: While technically valid, chaining multiple CNAME records (A -> CNAME -> CNAME -> A) adds latency and is generally discouraged. The generator warns about targets that are themselves likely to be CNAME records.

Relative vs. Fully Qualified Targets

  • Relative target (www): Expands using the zone origin. In a zone for example.com, the target www becomes www.example.com.
  • Fully qualified target (cdn.provider.net.): Used as-is. The trailing dot is critical -- without it, cdn.provider.net would be treated as relative and expand to cdn.provider.net.example.com.

External targets (pointing to other domains) must always use fully qualified names with trailing dots.

CNAME Records in Practice

The trailing dot on external CNAME targets is the single most common source of CNAME-related DNS outages. When you create a CNAME that points to a hostname in another domain -- a CDN, a cloud load balancer, a hosted service -- that target must end with a dot in the zone file. Without the dot, BIND appends the zone origin, and your cdn.provider.net target silently becomes cdn.provider.net.example.com, which does not exist. The result is that your CNAME appears to work in the zone file but resolves to NXDOMAIN, and the error is not obvious because the zone file looks correct at first glance.

When planning CNAME usage, think carefully about which names should be aliases and which should have direct A/AAAA records. A good rule of thumb: use CNAMEs for names whose target might change (like cloud load balancers or third-party services) and direct A/AAAA records for names that represent your own infrastructure with stable IPs. Overusing CNAMEs adds DNS resolution latency because each CNAME requires an additional lookup, and CNAME chains compound this effect.

For the zone apex problem, the standard solution depends on your DNS provider. If you use a provider that supports ALIAS, ANAME, or CNAME flattening (like Route 53, Cloudflare, or DNSimple), you can effectively alias the apex to another hostname. If you use standard BIND, you must use an A/AAAA record at the apex pointing directly to the IP address. This means that changes to the target IP require updating the apex record directly rather than relying on a CNAME indirection.

Frequently Asked Questions

Why can't I create a CNAME at the zone apex?

The DNS specification (RFC 1034) states that a CNAME record cannot coexist with other record types at the same name. Since the zone apex must have SOA and NS records, a CNAME there would violate this rule. Some DNS providers offer proprietary alternatives like ALIAS (DNSimple, Route 53), ANAME (PowerDNS), or CNAME flattening (Cloudflare) to achieve similar functionality at the apex.

What happens if I forget the trailing dot on an external target?

Without the trailing dot, BIND treats the target as relative to the zone origin. A target of cdn.provider.net in a zone for example.com would expand to cdn.provider.net.example.com, which almost certainly does not exist. Always use a trailing dot for external FQDN targets.

Can a CNAME point to another CNAME?

Technically yes, but it is discouraged. CNAME chains add DNS resolution latency because each link requires a separate lookup. Most DNS administrators prefer to point CNAME records directly at the final canonical hostname that has an A or AAAA record.

What is the difference between a CNAME and an A record?

An A record maps a name directly to an IPv4 address. A CNAME maps a name to another hostname, which must then be resolved to get the final IP address. CNAMEs are useful when the target IP may change (as with cloud load balancers), since updating the canonical name's A record automatically updates all aliases pointing to it.

Can I have a CNAME and an MX record for the same name?

No. The DNS specification prohibits any other record type from coexisting with a CNAME at the same name. If you need MX records for mail.example.com, that name must use an A/AAAA record, not a CNAME. This restriction is one of the most common sources of DNS misconfiguration.

What TTL should I use for CNAME records?

CNAME TTLs control how long the alias mapping is cached, not the final address. Use shorter TTLs (300-900 seconds) for CNAMEs that might need to be retargeted quickly, such as during migrations. For stable aliases that rarely change, 3600-86400 seconds is appropriate. Keep in mind that the effective caching time is also limited by the TTL of the target's A/AAAA record.

Related Tools

IPparseβ€’Free Network & Subnet Calculator Tools

Β© 2026 IPparse. All tools run locally in your browser.

100% Privacy-First β€’ No Data Collected