Send, receive, and shield emails with PostScale. One API, EU-hosted. PostScale

    RecordsBeginner

    DNS Record Types Explained

    Compare DNS record types with examples. Learn when to use A, AAAA, CNAME, MX, TXT, NS, CAA, SRV, SOA, PTR, HTTPS, SVCB, ALIAS, and more.

    Answer snapshot

    DNS records are instructions inside a DNS zone. A and AAAA point names to IP addresses, CNAME and ALIAS point names to other names, MX routes mail, TXT publishes verification and email-authentication data, NS and SOA describe authority, and CAA, SRV, PTR, TLSA, SSHFP, HTTPS, and SVCB handle security, service discovery, reverse DNS, and modern connection metadata.

    What you'll learn

    • Choose the right DNS record type for websites, apps, email, security, and service discovery
    • Read practical examples for common records such as A, CNAME, MX, TXT, CAA, and SRV
    • Avoid CNAME conflicts, broken email records, TTL mistakes, and DNSSEC-sensitive errors
    • Use DNScale tools and guides to check records after making changes

    DNS records control where a domain points, how email is routed, which services are available, and what security policies apply. This guide is the central DNScale reference for choosing record types, reading examples, avoiding common mistakes, and checking results with DNS tools.

    If you already know the record type you need, jump to the quick reference table. If you are deciding between options, start with A record vs CNAME record, DNS records for email, or DNS record conflicts and mistakes.

    Quick Reference

    Record typeWhat it doesCommon useExampleDetailed guide
    APoints a hostname to an IPv4 addressWebsite and app hostingwww.example.com -> 192.0.2.10A record guide
    AAAAPoints a hostname to an IPv6 addressIPv6 website and app hostingwww.example.com -> 2001:db8::10AAAA record guide
    CNAMEPoints one hostname to another hostnameSaaS, CDN, and www aliasesdocs.example.com -> example.gitbook.ioCNAME guide
    MXRoutes mail for a domainInbound email deliveryexample.com -> 10 mail.example.com.MX record guide
    TXTStores text valuesSPF, DKIM, DMARC, verificationv=spf1 include:_spf.example.com -allTXT record guide
    NSDelegates DNS authorityParent delegation or subdomain delegationexample.com -> ns1.provider.net.NS record guide
    SOADefines zone authority metadataZone administration and negative cachingprimary nameserver plus serial timersSOA record guide
    CAAControls certificate issuanceTLS certificate policy0 issue "letsencrypt.org"CAA record guide
    SRVDefines service host and portSIP, XMPP, LDAP, game servers10 5 5060 sip.example.com.SRV record guide
    PTRMaps IP address back to a hostnameReverse DNS and mail reputation10.2.0.192.in-addr.arpa -> host.example.com.PTR record guide
    TLSAPublishes DANE TLS associationAdvanced TLS validationcertificate association dataTLSA record guide
    SSHFPPublishes SSH host fingerprintsSSH host verificationalgorithm plus fingerprintSSHFP record guide
    HTTPSPublishes HTTPS service parametersHTTP/3, ECH, web connection hints1 . alpn="h3,h2"HTTPS record guide
    SVCBPublishes service binding metadataAlternative endpoints and service parametersservice priority and parametersSVCB record guide
    ALIASApex-friendly hostname aliasRoot domain to CDN or cloud targetexample.com -> target.example.net.ALIAS record guide

    DNScale documents customer-managed standard and modern record types in the records API. SOA is also explained here because every authoritative zone has one; the apex SOA and apex NS records are usually provider-managed system records, not routine records you edit by hand.

    What Is a DNS Record?

    A DNS record is an instruction inside a DNS zone. Each record normally has:

    FieldMeaning
    NameThe hostname, such as www, _dmarc, or example.com.
    TypeThe record type, such as A, CNAME, MX, or TXT
    ValueThe answer, such as an IP address, hostname, text string, or service parameter
    TTLHow long recursive resolvers may cache the answer
    PriorityExtra ordering value used by records such as MX and SRV

    Record conflicts matter because DNS has rules about which records can coexist. A CNAME must usually be the only record at its name. MX targets must resolve. DNSSEC DS and DNSKEY data must match. TTLs control how quickly changes become visible after resolvers cache old answers.

    A Records

    An A record maps a name to an IPv4 address.

    Name: www
    Type: A
    Value: 192.0.2.10
    TTL: 300

    Use A records when you control the IPv4 address, when you need the apex domain to point to a server, or when other records must coexist at the same name.

    Common mistakes:

    • Using a private IP address such as 10.0.0.5 for a public website.
    • Forgetting to update both apex and www.
    • Setting a high TTL before a migration.

    AAAA Records

    An AAAA record maps a name to an IPv6 address.

    Name: www
    Type: AAAA
    Value: 2001:db8::10
    TTL: 300

    Use AAAA records for dual-stack services so IPv6-capable clients can connect directly. Pair them with A records when the same service supports IPv4 and IPv6.

    Common mistakes:

    • Publishing AAAA before the service actually listens on IPv6.
    • Forgetting IPv6 firewall rules.
    • Testing only from IPv4 networks.

    CNAME Records

    A CNAME record aliases one hostname to another hostname.

    Name: docs
    Type: CNAME
    Value: example.gitbook.io.
    TTL: 3600

    Use CNAME records for subdomains that should follow a third-party service, CDN, or SaaS target. Do not use a CNAME at a name that also needs MX, TXT, CAA, or other record data.

    Common mistakes:

    • Putting a CNAME at the apex/root domain.
    • Creating long CNAME chains.
    • Combining CNAME with TXT verification at the same name.

    For a deeper decision framework, read CNAME vs A record.

    MX Records

    MX records tell senders where to deliver email for a domain. They include a priority and a mail server hostname.

    Name: example.com.
    Type: MX
    Value: 10 mail.example.com.
    TTL: 3600

    Use MX records for domains and subdomains that receive email. Lower priority numbers are preferred.

    Common mistakes:

    • Pointing MX to a hostname that has no A or AAAA record.
    • Missing the provider-required priority.
    • Using a CNAME as the MX target when the mail provider expects a direct hostname.

    TXT Records

    TXT records store text values. They are widely used for email authentication and domain verification.

    Name: example.com.
    Type: TXT
    Value: v=spf1 include:_spf.example.com -all
    TTL: 3600

    Use TXT records for SPF, DKIM, DMARC, Google/Microsoft verification, MTA-STS reporting, and service-specific ownership checks.

    Common mistakes:

    • Publishing multiple SPF records at the same name.
    • Putting DMARC at example.com instead of _dmarc.example.com.
    • Leaving stale verification records after a migration.

    NS Records

    NS records identify authoritative nameservers. At the parent zone, they delegate the domain to a DNS provider. Inside a zone, they can delegate a subdomain.

    Name: dev.example.com.
    Type: NS
    Value: ns1.dev-provider.net.
    TTL: 3600

    Use NS records carefully. Parent-zone delegation and in-zone NS records need to agree during migrations.

    Common mistakes:

    • Parent and child NS records disagreeing after a provider migration.
    • Delegating a subdomain without creating the child zone.
    • Changing NS records without lowering TTLs first.

    SOA Records

    An SOA record stores zone authority metadata: primary nameserver, responsible mailbox, serial number, refresh, retry, expire, and minimum/negative-cache TTL.

    Name: example.com.
    Type: SOA
    Value: ns1.dnscale.eu. hostmaster.example.com. 2026060901 3600 600 604800 300

    Every authoritative zone has an SOA record. In managed DNS, the apex SOA is usually generated and maintained by the provider.

    Common mistakes:

    • Treating the SOA serial as application state.
    • Misreading negative-cache TTL as a normal record TTL.
    • Trying to hand-edit provider-managed SOA data during a migration.

    CAA Records

    CAA records restrict which public certificate authorities can issue TLS certificates for a domain.

    Name: example.com.
    Type: CAA
    Value: 0 issue "letsencrypt.org"
    TTL: 3600

    Use CAA records when you want explicit certificate authority policy. Add issuewild when wildcard certificates should have separate rules.

    Common mistakes:

    • Forgetting the CA used by your CDN or hosting provider.
    • Leaving old CA values after moving certificate automation.
    • Making the record too restrictive before a certificate renewal.

    SRV Records

    SRV records publish service location, including priority, weight, port, and target.

    Name: _sip._tcp.example.com.
    Type: SRV
    Value: 10 5 5060 sip.example.com.
    TTL: 3600

    Use SRV records for protocols that explicitly support service discovery, such as SIP, XMPP, LDAP, Kerberos, and some game servers.

    Common mistakes:

    • Missing the leading service and protocol labels, such as _sip._tcp.
    • Forgetting that the SRV target still needs A/AAAA records.
    • Mixing up priority and weight.

    PTR Records

    PTR records map an IP address back to a hostname in a reverse DNS zone.

    Name: 10.2.0.192.in-addr.arpa.
    Type: PTR
    Value: host.example.com.
    TTL: 3600

    Use PTR records for reverse DNS, especially mail server reputation and infrastructure identification. In many cases, the IP address owner controls the reverse zone, not the domain owner.

    Common mistakes:

    • Trying to set PTR in the forward zone.
    • Publishing PTR that does not match the server's forward A/AAAA records.
    • Assuming you can control reverse DNS for cloud IPs without provider support.

    Advanced Record Types

    TLSA Records

    TLSA records publish DANE certificate associations. They are only meaningful when DNSSEC validation protects the zone.

    SSHFP Records

    SSHFP records publish SSH host key fingerprints so clients can verify host keys through DNSSEC-protected DNS.

    HTTPS Records

    HTTPS records publish web service metadata such as HTTP/3 support, alternative endpoints, and ECH-related hints.

    SVCB Records

    SVCB records are the generic service-binding form behind HTTPS records.

    ALIAS Records

    ALIAS records provide CNAME-like behavior at the apex while allowing required apex records such as SOA, NS, MX, and TXT to coexist.

    DNS Record Examples

    TaskNameTypeValueTTL
    Point root domain to websiteexample.com.A192.0.2.10300
    Add IPv6 for websiteexample.com.AAAA2001:db8::10300
    Point www to apexwww.example.com.CNAMEexample.com.3600
    Connect email providerexample.com.MX10 mail.example.com.3600
    Publish SPFexample.com.TXTv=spf1 include:_spf.example.com -all3600
    Publish DMARC_dmarc.example.com.TXTv=DMARC1; p=quarantine; rua=mailto:dmarc@example.com3600
    Restrict certificate issuersexample.com.CAA0 issue "letsencrypt.org"3600
    Publish service discovery_sip._tcp.example.com.SRV10 5 5060 sip.example.com.3600
    Use apex hostname aliasexample.com.ALIAStarget.example.net.300

    To manage these as code, see Managing DNS with Terraform and the DNScale API records docs.

    A Record vs CNAME Record

    Use caseA recordCNAME record
    Points toIPv4 addressHostname
    Can be used at zone apexYesUsually no
    Good forFixed IPs, root domains, coexistence with other recordsSubdomains and third-party targets
    CoexistenceCan coexist with some other record typesMust usually be the only record at that name
    Operational riskYou must update IPs when they changeThe target owner controls final IPs

    Use A records when you control the destination IP or need the apex domain. Use CNAME when a subdomain should follow a provider-controlled hostname. If you need CNAME-like behavior at the apex, use ALIAS records where supported.

    DNS Records for Email

    Email DNS usually combines several record types:

    PurposeRecord typeNameNotes
    Route inbound mailMXexample.com.Points to provider mail hosts
    Authorize sending serversTXTexample.com.SPF policy
    Verify signed mailTXT or CNAMEselector._domainkey.example.com.DKIM public key or selector delegation
    Publish receiver policyTXT_dmarc.example.com.DMARC policy and reporting
    Advertise TLS policyTXT_mta-sts.example.com.Optional MTA-STS
    Report TLS failuresTXT_smtp._tls.example.com.Optional TLS-RPT

    Use the SPF validator, DKIM validator, and DMARC validator to check common email DNS mistakes. For the full email-authentication overview, read email security with SPF, DKIM, and DMARC.

    DNS TTL Explained

    TTL means time to live. It tells recursive resolvers how long they can cache an answer.

    TTL patternUse caseTrade-off
    60-300 secondsMigrations, failover, changing recordsFaster updates, more queries
    3600 secondsNormal website and email recordsBalanced cache behavior
    86400 secondsVery stable recordsFewer queries, slower change visibility

    Lower TTLs before a planned migration, wait for old caches to expire, make the change, verify, then restore a normal TTL. For details, read DNS TTL best practices and use the DNS propagation checker after changes.

    DNS Record Conflicts and Mistakes

    MistakeWhy it breaksFix
    CNAME at same name as MX/TXTCNAME cannot coexist with other record dataUse A/AAAA/ALIAS or move the conflicting record
    CNAME at apexApex needs SOA and NS recordsUse A, AAAA, or ALIAS
    Missing MX target A/AAAAMail servers cannot resolve the mail hostAdd address records for the MX target
    Multiple SPF TXT recordsSPF receivers expect one policy recordMerge SPF mechanisms into one TXT value
    DMARC at wrong nameReceivers only check _dmarcPublish at _dmarc.example.com.
    CAA too restrictiveCertificate authority cannot issueAdd the CA your automation uses
    TTL too high before migrationOld answers remain cached longerLower TTL before the change window
    NS delegation mismatchParent and child authority disagreeCompare registrar NS and in-zone NS
    DNSSEC DS mismatchValidators return SERVFAILCoordinate DS and DNSKEY changes carefully

    For broad troubleshooting, see DNS troubleshooting, SERVFAIL explained, and NXDOMAIN explained.

    How To Check DNS Records

    Use the right tool for the question:

    QuestionTool
    What does this record currently resolve to?DNS lookup tool
    Has my change reached public resolvers?DNS propagation checker
    Are delegation, SOA, DNSSEC, MX, SPF, DMARC, and CAA healthy?Zone health check
    Is my DNSSEC chain valid?DNSSEC chain validator
    Is my SPF record valid?SPF validator
    Is my DKIM selector valid?DKIM validator
    Is my DMARC policy valid?DMARC validator

    After a DNS change, check authoritative answers first, then recursive resolver caches. A resolver serving the old answer may simply be honoring the previous TTL.

    Managing DNS Records With DNScale

    DNScale lets you manage authoritative DNS records through the dashboard, API, Terraform provider, and DNSControl.

    MethodBest for
    DashboardFast manual edits, exploration, emergency changes
    APICustom automation and application workflows
    TerraformInfrastructure-as-code teams using HCL and remote state
    DNSControlDNS-specific code workflows and multi-provider DNS

    If multiple people or environments touch DNS, pick one source of truth per zone. For Terraform, use the DNScale Terraform provider guide. For JavaScript-based DNS as code, use the DNSControl guide. For direct API automation, start with the records API docs.

    ResourceWhy it helps
    CNAME vs A recordChoose between IP mapping and hostname aliasing
    DNS MX record explainedConfigure email routing
    DNS TXT record guideSPF, DKIM, DMARC, and verification records
    DNS TTL best practicesPlan cache behavior and migrations
    Fully qualified domain namesUnderstand names, trailing dots, and record targets
    DNS server typesUnderstand recursive, root, TLD, and authoritative servers
    Managing DNS with TerraformManage records as code
    DNS lookup toolQuery current records
    DNS propagation checkerCompare resolver caches after changes
    Zone health checkAudit production DNS and mail basics

    Start Managing Records Safely

    Need to manage records across multiple domains? DNScale gives you authoritative DNS with dashboard editing, API access, Terraform, DNSControl, DNSSEC tooling, and record-checking tools for safe changes.

    Frequently asked questions

    What are DNS record types?
    DNS record types define what kind of answer a DNS name provides. For example, A returns an IPv4 address, MX returns mail exchangers, TXT returns text values, and CAA controls certificate authority authorization.
    What is the difference between an A record and a CNAME record?
    An A record points directly to an IPv4 address. A CNAME points one hostname to another hostname. Use A records for apex domains and fixed IPs; use CNAME for subdomains that follow a third-party hostname.
    Which DNS records are required for a website?
    Most websites need A and/or AAAA records for the apex domain and either a CNAME or A/AAAA records for www. Some providers use ALIAS at the apex or HTTPS records for modern connection hints.
    Which DNS records are required for email?
    Email usually needs MX records for routing plus TXT records for SPF and DMARC. DKIM is commonly a TXT record, though some email providers use CNAME records for selector delegation.
    What is a TXT record used for?
    TXT records store text values. Common uses include SPF, DKIM, DMARC, domain ownership verification, MTA-STS reporting, and service-specific verification tokens.
    What is the difference between SPF, DKIM, and DMARC records?
    SPF authorizes sending servers, DKIM publishes a public key used to verify signed messages, and DMARC tells receivers what to do when SPF and DKIM alignment fail.
    What is a CAA record?
    A CAA record tells public certificate authorities which CAs are allowed to issue TLS certificates for a domain. A restrictive CAA record can block certificate issuance if it does not list the CA you use.
    What does TTL mean in DNS records?
    TTL is the time to live in seconds. It tells recursive resolvers how long they may cache a DNS answer before asking again.
    Can a CNAME record be used at the root domain?
    Usually no. The root or apex name must also hold SOA and NS records, and a CNAME cannot coexist with other record data. Use A, AAAA, or provider-supported ALIAS records instead.
    How do I check which DNS records a domain has?
    Use a DNS lookup tool for a specific record type, a propagation checker after changes, a zone health check for broad DNS and mail checks, and a DNSSEC checker for signed zones.

    Related guides

    Ready to manage your DNS with confidence?

    DNScale provides anycast DNS hosting with a global network, real-time analytics, and an easy-to-use API.

    Start free