All Products
Search
Document Center

Direct Mail:Verify DNS configuration for your email domain

Last Updated:May 27, 2026

Verify that your email domain DNS records (ownership, SPF, DKIM, DMARC, MX) are correctly configured using the Alibaba Cloud DNS check tool, Windows nslookup, or Linux/macOS dig. Examples use example.com as the root domain.

Example: sub.example.com in the China (Hangzhou) region

sub.example.com is a subdomain of example.com with the prefix sub.

Note
  • Before running these queries, configure the required DNS records at your domain name service provider. Find the record values in the Direct Mail console under Email Domains > Configure.

  • When you run queries, replace the example domain name with your own domain name.

1. Query using the Alibaba Cloud DNS check tool

1. Ownership verification

  • Purpose: Proves domain ownership by adding a TXT record provided by the service provider.

  • Domain to query: aliyundm.sub.example.com

  • Record type: TXT

image

2. SPF (Sender Policy Framework)

  • Purpose: Prevents sender spoofing by specifying which servers can send email for your domain.

  • Domain to query: sub.example.com

  • Record type: TXT

image

Note

1. You can have only one SPF record. If you have multiple outbound IP addresses, merge them into a single record.

Example of value parsing syntax:

Domain + Domain: v=spf1 include:spf.qiye.aliyun.com include:spf1.dm.aliyun.com -all

Domain + IP address: v=spf1 include:spf.qiye.aliyun.com ip4:x.x.x.x -all

Domain + IP range (use with caution): v=spf1 include:spf.qiye.aliyun.com ip4:x.x.x.x/24 -all

Note: Use ip4, not ipv4.

2. Do not use a domain shared with a corporate mailbox for Direct Mail — this may disrupt corporate email delivery. Use a subdomain instead.

3. DKIM (DomainKeys Identified Mail)

  • Purpose: Uses a digital signature to verify email integrity and prevent tampering in transit.

  • Domain to query: aliyun-cn-hangzhou._domainkey.sub.example.com (host record + root domain)

  • Record type: TXT

Note

The selector value (e.g., aliyun-cn-hangzhou) varies by region.

Older domains may not include the 1024 or 2048 key length identifier in the host record. Always use the exact host record shown on the Email Domains > Configure page.

  • Original:

    • China (Hangzhou): aliyun-cn-hangzhou._domainkey.sub.example.com

    • Singapore: aliyun-ap-southeast-1._domainkey.sub.example.com

    • US: aliyun-us-east-1._domainkey.sub.example.com or aliyun-ap-southeast-2._domainkey.sub.example.com (for some older domains)

    • Germany: aliyun-eu-central-1._domainkey.sub.example.com

  • 1024-bit:

    • China (Hangzhou): aliyun-cn-hangzhou-1024._domainkey.sub.example.com

    • Singapore: aliyun-ap-southeast-1-1024._domainkey.sub.example.com

    • US: aliyun-us-east-1-1024._domainkey.sub.example.com

    • Germany: aliyun-eu-central-1-1024._domainkey.sub.example.com

  • 2048-bit:

    • China (Hangzhou): aliyun-cn-hangzhou-2048._domainkey.sub.example.com

    • Singapore: aliyun-ap-southeast-1-2048._domainkey.sub.example.com

    • US: aliyun-us-east-1-2048._domainkey.sub.example.com

    • Germany: aliyun-eu-central-1-2048._domainkey.sub.example.com

image

4. DMARC (Domain-based Message Authentication, Reporting, and Conformance)

  • Purpose: Defines how to handle emails that fail SPF or DKIM checks and enables authentication reporting.

  • Domain to query: TXT record of _dmarc.sub.example.com

  • Record type: TXT

image

5. MX (Mail Exchange) record

  • Purpose: Specifies the mail server that accepts email for your domain.

  • Domain to query: sub.example.com

  • Record type: MX

image

2. Other query methods

1. nslookup (Windows)

  • Ownership verification, SPF, DMARC, and MX records:

    nslookup -type=TXT aliyundm.sub.example.com # Ownership record
    nslookup -type=TXT sub.example.com        # SPF record
    nslookup -type=TXT _dmarc.sub.example.com # DMARC record
    nslookup -type=MX sub.example.com         # MX record
  • DKIM example:

    # Query using the corresponding region.
    
    # Original:
    # China (Hangzhou):
    nslookup -type=TXT aliyun-cn-hangzhou._domainkey.sub.example.com
    # Singapore:
    nslookup -type=TXT aliyun-ap-southeast-1._domainkey.sub.example.com
    # US:
    nslookup -type=TXT aliyun-us-east-1._domainkey.sub.example.com
    nslookup -type=TXT aliyun-ap-southeast-2._domainkey.sub.example.com
    # Germany:
    nslookup -type=TXT aliyun-eu-central-1._domainkey.sub.example.com
    
    # 1024-bit:
    # China (Hangzhou):
    nslookup -type=TXT aliyun-cn-hangzhou-1024._domainkey.sub.example.com
    # Singapore:
    nslookup -type=TXT aliyun-ap-southeast-1-1024._domainkey.sub.example.com
    # US:
    nslookup -type=TXT aliyun-us-east-1-1024._domainkey.sub.example.com
    # Germany:
    nslookup -type=TXT aliyun-eu-central-1-1024._domainkey.sub.example.com
    
    # 2048-bit:
    # China (Hangzhou):
    nslookup -type=TXT aliyun-cn-hangzhou-2048._domainkey.sub.example.com
    # Singapore:
    nslookup -type=TXT aliyun-ap-southeast-1-2048._domainkey.sub.example.com
    # US:
    nslookup -type=TXT aliyun-us-east-1-2048._domainkey.sub.example.com
    # Germany:
    nslookup -type=TXT aliyun-eu-central-1-2048._domainkey.sub.example.com

Query the ownership record: nslookup -qt=TXT aliyundm.your-configured-domain

image

Query the SPF record: nslookup -qt=TXT your-configured-domain

image

Query the MX record: nslookup -qt=MX your-configured-domain

image

2. dig (Linux/macOS)

  • Ownership verification, SPF, DMARC, and MX records:

    dig TXT aliyundm.sub.example.com # Ownership record
    dig TXT sub.example.com           # SPF record
    dig TXT _dmarc.sub.example.com    # DMARC record
    dig MX sub.example.com            # MX record
  • DKIM example:

    # Query using the corresponding region.
    
    # Original:
    # China (Hangzhou):
    dig TXT aliyun-cn-hangzhou._domainkey.sub.example.com
    # Singapore:
    dig TXT aliyun-ap-southeast-1._domainkey.sub.example.com
    # US:
    dig TXT aliyun-us-east-1._domainkey.sub.example.com
    dig TXT aliyun-ap-southeast-2._domainkey.sub.example.com
    # Germany:
    dig TXT aliyun-eu-central-1._domainkey.sub.example.com
    
    # 1024-bit:
    # China (Hangzhou):
    dig TXT aliyun-cn-hangzhou-1024._domainkey.sub.example.com
    # Singapore:
    dig TXT aliyun-ap-southeast-1-1024._domainkey.sub.example.com
    # US:
    dig TXT aliyun-us-east-1-1024._domainkey.sub.example.com
    # Germany:
    dig TXT aliyun-eu-central-1-1024._domainkey.sub.example.com
    
    # 2048-bit:
    # China (Hangzhou):
    dig TXT aliyun-cn-hangzhou-2048._domainkey.sub.example.com
    # Singapore:
    dig TXT aliyun-ap-southeast-1-2048._domainkey.sub.example.com
    # US:
    dig TXT aliyun-us-east-1-2048._domainkey.sub.example.com
    # Germany:
    dig TXT aliyun-eu-central-1-2048._domainkey.sub.example.com

Query the ownership record: dig txt aliyundm.your-configured-domain

image

Query the SPF record: dig txt your-configured-domain

image

Query the MX record: dig mx your-configured-domain

image