All Products
Search
Document Center

Alibaba Cloud DNS:Test DNS resolution

Last Updated:Jun 17, 2026

If you cannot access your website or a DNS record is not resolving correctly, use the following methods to check the status of your domain name and verify that the DNS record is effective.

dig and nslookup commands

Common command-line tools for DNS queries include dig, which provides detailed debugging information, and nslookup, which is included by default in Windows.

Important

How to interpret the results: If the DNS query output matches your configured settings in Alibaba Cloud DNS, the DNS record has propagated.

If the output does not match, check the TTL. If the local cache is still valid, wait for it to expire before testing again.

If the cache has expired and the results still do not match, see Quickly troubleshoot ineffective resolution issues.

Dig command

1. Basic query

Note

Command: dig <your_domain_name> (Example: dig example.com)

$ dig example.com
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7585
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.                   IN      A

;; ANSWER SECTION:
example.com.            10      IN      A       96.7.128.175
example.com.            10      IN      A       96.7.128.198
example.com.            10      IN      A       23.192.228.84
example.com.            10      IN      A       23.215.0.136
example.com.            10      IN      A       23.192.228.80
example.com.            10      IN      A       23.215.0.138

;; Query time: 0 msec
;; WHEN: Tue Feb 18 13:31:55 CST 2025
;; MSG SIZE  rcvd: 125

2. Query by record type

Note

Command: dig <your_domain_name> <record_type> (Example: dig example.com NS)

$ dig example.com NS
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com NS
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29146
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.                   IN      NS

;; ANSWER SECTION:
example.com.            10      IN      NS      b.iana-servers.net.
example.com.            10      IN      NS      a.iana-servers.net.

;; Query time: 0 msec
;; WHEN: Tue Feb 18 15:03:03 CST 2025
;; MSG SIZE  rcvd: 93

The following example shows the output when a DNS record has not propagated or has not been configured (Example: dig example.com cname).

$ dig example.com cname
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com cname
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39890
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.                   IN      CNAME

;; AUTHORITY SECTION:
example.com.            5       IN      SOA     ns.icann.org. noc.dns.icann.org. 2025011545 7200 3600 1209600 3600

;; Query time: 143 msec
;; WHEN: Tue Feb 18 13:50:18 CST 2025
;; MSG SIZE  rcvd: 94

3. Query a specific DNS server

Note

Alibaba Cloud DNS server command: dig <your_domain_name> @ns1.alidns.com (Example: dig example.com @ns1.alidns.com)

Public DNS server command: dig <your_domain_name> @223.5.5.5 (Example: dig example.com @223.5.5.5)

$ dig example.com @ns1.alidns.com
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com @ns1.alidns.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32895
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096

;; QUESTION SECTION:
;example.com.                   IN      A

;; AUTHORITY SECTION:
example.com.            600     IN      SOA     ns1.alidns.com. hostmaster.hichina.com. 2025021713 3600 1200 86400 600

;; Query time: 5 msec
;; WHEN: Tue Feb 18 15:22:09 CST 2025
;; MSG SIZE  rcvd: 112
$ dig example.com @223.5.5.5
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com @223.5.5.5
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42292
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1408

;; QUESTION SECTION:
;example.com.                   IN      A

;; ANSWER SECTION:
example.com.            67      IN      A       96.7.128.175
example.com.            67      IN      A       96.7.128.198
example.com.            67      IN      A       23.215.0.136
example.com.            67      IN      A       23.215.0.138
example.com.            67      IN      A       23.192.228.84
example.com.            67      IN      A       23.192.228.80

;; Query time: 1 msec
;; SERVER: 223.5.5.5#53(223.5.5.5)
;; WHEN: Tue Feb 18 15:16:32 CST 2025
;; MSG SIZE  rcvd: 136

4. Trace the resolution path with dig +trace

Note

Command: dig <your_domain_name> +trace (Example: dig example.com +trace)

$ dig example.com +trace
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> example.com +trace
;; global options: +cmd
.                       515049  IN      NS      j.root-servers.net.
.                       515049  IN      NS      k.root-servers.net.
.                       515049  IN      NS      a.root-servers.net.
.                       515049  IN      NS      b.root-servers.net.
.                       515049  IN      NS      c.root-servers.net.
.                       515049  IN      NS      d.root-servers.net.
.                       515049  IN      NS      e.root-servers.net.
.                       515049  IN      NS      f.root-servers.net.
.                       515049  IN      NS      g.root-servers.net.
.                       515049  IN      NS      h.root-servers.net.
.                       515049  IN      NS      i.root-servers.net.
.                       515049  IN      NS      l.root-servers.net.
.                       515049  IN      NS      m.root-servers.net.
;; Received 819 bytes from 100.100.2.136#53(100.100.2.136) in 1 ms

com.                    172800  IN      NS      e.gtld-servers.net.
com.                    172800  IN      NS      b.gtld-servers.net.
com.                    172800  IN      NS      j.gtld-servers.net.
com.                    172800  IN      NS      m.gtld-servers.net.
com.                    172800  IN      NS      i.gtld-servers.net.
com.                    172800  IN      NS      f.gtld-servers.net.
com.                    172800  IN      NS      a.gtld-servers.net.
com.                    172800  IN      NS      g.gtld-servers.net.
com.                    172800  IN      NS      h.gtld-servers.net.
com.                    172800  IN      NS      c.gtld-servers.net.
com.                    172800  IN      NS      d.gtld-servers.net.
com.                    172800  IN      NS      l.gtld-servers.net.
com.                    172800  IN      NS      k.gtld-servers.net.
;; Received 839 bytes from 198.41.0.4#53(a.root-servers.net) in 2 ms

example.com.            172800  IN      NS      a.iana-servers.net.
example.com.            172800  IN      NS      b.iana-servers.net.
;; Received 326 bytes from 192.26.92.30#53(c.gtld-servers.net) in 2 ms

example.com.            86400   IN      A       96.7.128.175
example.com.            86400   IN      A       96.7.128.198
example.com.            86400   IN      A       23.192.228.84
example.com.            86400   IN      A       23.215.0.136
example.com.            86400   IN      A       23.192.228.80
example.com.            86400   IN      A       23.215.0.138
;; Received 134 bytes from 199.43.135.53#53(a.iana-servers.net) in 143 ms

5. Find the client's public egress IP

Note

Command: dig +short TXT whoami.ds.akahelp.net

$ dig +short TXT whoami.ds.akahelp.net
"ns"
"47.xxx.xxx.14"

6. Find the DNS servers for a domain

Note

Command: dig ns <your_domain_name> (Only the root domain name is required.)

$ dig ns example.com
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> ns example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58283
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.                   IN      NS

;; ANSWER SECTION:
example.com.            10      IN      NS      a.iana-servers.net.
example.com.            10      IN      NS      b.iana-servers.net.

;; Query time: 5 msec
;; SERVER:
;; WHEN: Tue Feb 18 16:09:33 CST 2025
;; MSG SIZE  rcvd: 93

7. Test intelligent resolution accuracy

Note

Command: dig @<authoritative_dns_server> <domain_name> +subnet=<client_ip> (Example: dig @ns1.alidns.com example.com +subnet=10.10.10.10)

$ dig @ns1.alidns.com example.com +subnet=10.10.10.10
; <<>> DiG 9.11.36-RedHat-9.11.36-16.0.1.al8 <<>> @ns1.alidns.com example.com +subnet=10.10.10.10
; (9 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60880
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; CLIENT-SUBNET: 10.10.10.10/32/24

;; QUESTION SECTION:
;example.com.                   IN      A

;; AUTHORITY SECTION:
example.com.            600     IN      SOA     ns1.alidns.com. hostmaster.hichina.com. 2024120417 3600 1200 86400 600

;; Query time: 0 msec
;; SERVER:
;; WHEN: Tue Feb 18 16:19:41 CST 2025
;; MSG SIZE  rcvd: 124

Nslookup command

1. Check local DNS resolution results.

Note

Command: nslookup <your_domain_name> (Example: nslookup example.com)

$ nslookup example.com
Server:         xxx
Address:        xxx#53

Non-authoritative answer:
Name:   example.com
Address: 23.192.228.84
Name:   example.com
Address: 23.215.0.136
Name:   example.com
Address: 23.192.228.80
Name:   example.com
Address: 23.215.0.138
Name:   example.com
Address: 96.7.128.175
Name:   example.com
Address: 96.7.128.198
Name:   example.com
Address: 2600:1408:ec00:36::1736:7f31
Name:   example.com
Address: 2600:1408:ec00:36::1736:7f24
Name:   example.com
Address: 2600:1406:bc00:53::b81e:94ce
Name:   example.com
Address: 2600:1406:bc00:53::b81e:94c8
Name:   example.com
Address: 2600:1406:3a00:21::173e:2e66
Name:   example.com
Address: 2600:1406:3a00:21::173e:2e65

2. Query a public DNS server

Note

Command: nslookup <your_domain_name> <public_dns_server> (Example using an Alibaba Cloud public DNS server: nslookup example.com 223.5.5.5)

$ nslookup example.com 223.5.5.5
Server:         223.5.5.5
Address:        223.5.5.5#53

Non-authoritative answer:
Name:   example.com
Address: 23.192.228.84
Name:   example.com
Address: 23.215.0.138
Name:   example.com
Address: 23.215.0.136
Name:   example.com
Address: 23.192.228.80
Name:   example.com
Address: 96.7.128.175
Name:   example.com
Address: 96.7.128.198
Name:   example.com
Address: 2600:1406:3a00:21::173e:2e65
Name:   example.com
Address: 2600:1406:bc00:53::b81e:94ce
Name:   example.com
Address: 2600:1408:ec00:36::1736:7f24
Name:   example.com
Address: 2600:1406:3a00:21::173e:2e66
Name:   example.com
Address: 2600:1406:bc00:53::b81e:94c8
Name:   example.com
Address: 2600:1408:ec00:36::1736:7f31

3. Query by record type

Note

Command: nslookup -type=<record_type> <your_domain_name> (Example: nslookup -type=NS example.com)

$ nslookup -type=NS example.com
Server:         100.100.2.136
Address:        100.100.2.136#53

Non-authoritative answer:
example.com     nameserver = b.iana-servers.net.
example.com     nameserver = a.iana-servers.net.

Authoritative answers can be found from:

4. Query a specific authoritative server

Note

Command: nslookup <your_domain_name> <authoritative_server> (Example: nslookup example.com ns1.alidns.com)

$ nslookup example.com ns1.alidns.com
Server:         ns1.alidns.com
Address:        120.76.107.55#53

*** Can't find example.com: No answer