Test DNS resolution

更新时间:
复制 MD 格式

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.

Domain detection

  1. Go to Alibaba Cloud DNS - Public Authoritative Resolution.

  2. Click Domain Detection next to the target domain name.

  3. In the dialog box that appears, select the DNS record that you want to check.

    The Domain Resolution Self-service Diagnosis dialog box appears. At the top of the dialog box, you can enter a host record and a domain name to start a query. The list below displays all subdomains for the current domain name and their last modification times. Click Start Diagnosis next to the relevant record to begin the check.

    After the diagnosis is complete, the results are displayed on the page. If the domain name resolution is successful, a green message is displayed. If the service is still not working correctly, click Unresolved to provide feedback, or click Solved, Close to close the dialog box.

Network diagnosis and analysis

Alibaba Cloud DNS provides Network Diagnosis and Analysis, a visual tool to help you detect issues with your domain name, DNS, and website.

  1. Open Network Diagnosis and Analysis.

  2. Enter the domain name that you want to test and click Detect Now.

    The results page is divided into three sections: domain check (shows information such as the domain registrar, expiration date, and status), dns check (shows information such as the DNS provider, resolution results, recursive resolution trace, and TTL), and website check (shows information such as ICP filing status, blocklist status, ping check results, and website status codes).

    For a description of the fields in each section, see Check a domain name.

Network probe tool

Method 1: Go directly to Network Probe Tool - DNS Probe and enter the target domain name to start the test.

Method 2:

  1. Go to Alibaba Cloud DNS - Public Authoritative Resolution.

  2. Click dns settings next to the target domain name to go to the DNS record details page.

  3. Find the target DNS record and click Effectiveness Check in the record's row.

Example results

The DNS probe results page supports multiple test types, including HTTP, PING, DNS, MTR, and Traceroute. Enter a domain name and click Probe Now to begin the test. After the test is complete, the page displays a Probe Result summary and a Probe Overview. The overview section includes a map showing the geographic distribution of monitoring nodes and detailed data from each node, such as resolution results and resolution time.

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