The first line of nslookup isn't the DNS you entered, so non-authoritative responses aren't wrong

Let's first understand this two-part structure: the first half is about who you asked
nslookup's output is always two-segment. The first half has two lines: "Server" and "Address," which state whose DNS your computer is currently using; The second half is the query results, with lines like "Name" and "Addresses." For those who don't understand it for the first time, ninety percent of them will take the first half as the answer.
Okay, 192.168.31.1 Why wasn't it you who filled it out? 223.5.5.5? Because the router has a DNS proxy enabled: the computer's DNS points to the gateway, and the gateway receives the problem and then asks 223.5.5.5, which returns the answer via the same route. Whether the DNS you entered in the router's backend is effective or not has nothing to do with what the computer line shows—it only means "the computer has handed the problem over to the router." If you want to know who the router actually uses, you need to ask the specified server, which will be explained later.
By the way, the "Server" line often shows UnKnown, which is not a fault. This means your DNS server hasn't set itself up with reverse resolution (PTR records). nslookup wanted to report its name but didn't get it, so it wrote UnKnown, and the address can still be used.
Non-authoritative response: Not wrong, it's 'retelling.'
That line of the most intimidating "non-authoritative response" can be summed up in one sentence: this answer wasn't spoken by me personally, but was pulled out of the cache and retold to you. The definition of authoritative response is reversed—the answer given by the DNS server of the domain name.
I personally ran this link using my own domain name. First, check who the authority is: nslookup -type=ns shunot.com, get two NS records, freens1.jdgslb.com and freens2.jdgslb.com. These are JD Cloud machines, and my domain is hosted by them. Then parse freens1 to get the IP (116.196.126.18), and directly ask it for the address of the www.shunot.com — the answer doesn't include the line "Non-authoritative response," the address 49.51.202.150 is exactly the same as the public DNS report.
So what you find in daily life is always a non-authoritative response, because public DNS like 223.5.5.5 is basically a middleman, running errands and handing you cached answers. The answer expired, and there is no other number in the answer to tell you: TTL. I used three DNS servers to check the same domain at the same time: Alibaba reported 120 seconds, Tencent reported 120 seconds, 114 reported 603 seconds—same IP, but the old and new caches of the three companies differed, behind this is the cache ledger in the parsing process.
Five commonly used postures, all recorded in one chart
This command has only five possible uses, and I ran each one to the real data:
| What do you want to do | ? How do you type? | I got the result |
|---|---|---|
| Daily, I check the IP of the domain | name nslookup www.shunot.com | 49.51.202.150 |
| Specify the server to bypass the router | nslookup www.shunot.com 223.5.5.5 | Same IP, server line becomes 223.5.5.5 Main |
| User. Search for other record types | : nslookup -type=ns/mx/txt/aaaa domain | NS: Findauthority, MX: Find email, TXT: Find validation string |
| Ask several times | in a row,just tap nslookup and press Enter, enter > prompt | server 223.5.5.5 Change server, set type=mx Change type, exit Check |
| if IPv6 has | nslookup -type=aaaa www.shunot.com | 240d:c000:f07f:9500:7492:9fa8:c010:0 |
The second position is the most valuable. Verify that the DNS changes on the router are not effective. Don't be fooled by the default output—just specify the server to ask: If the answer matches the authoritative answer, it means the link is connected; If you want to confirm which router you are using, go to the router's WAN port status page; the command does not control that layer. Additionally, you can directly fill in the domain name for the "Server" line, for example, nslookup www.shunot.com one.one.one.one, provided your local DNS can first resolve one.one.one.one to 1.1.1.
If you can't find it, there are three types of words, each with completely different meanings. The first type is "NXDOMAIN" or DNS request timed out followed by "no such name," meaning the domain itself does not exist. I casually created a bucunzai-shunot-test-abc.com to ask, and the response was this type, called rcode=3 in the protocol. The second is that the entire timeout request timed out, meaning the DNS server didn't respond at all—it's a channel issue, not a domain name. Try switching DNS and ask or < a href="https://www.shunot.com/en/lybk/1159.html"> check if UDP 53 has been tampered with. The third type of "no record of this type" is the least popular: the domain name is fine, but it doesn't have the kind of record you want. For example, my domain doesn't have MX. If I ask where the email goes, the answer is no, but that doesn't mean the website is broken.
Practical Exercise 1: Suspecting DNS being pretended to answer, use a code domain name to ask around
When
it comes to changing DNS, what I care about most is whether the carrier rushes to answer—you fill in 223.5.5.5, get intercepted halfway to answer for you, and it's basically a wasted answer. 114 has an official domain detection whether.114dns.com specifically for this. I used it to ask between two DNS providers, and the results were interesting: asking 114.114.114.114, answering 127.0.0.218 and 127.0.0.208; asking 223.5.5.5, answering 127.0.0.1.
Each company provides a different loopback address; this is their own "normal code"—127 starts with the local loop segment, and normal DNS forwards the address truthfully, so the answer is always the agreed address; If a middleman snatches the answer, the domain is probably unfamiliar and will return an NXDOMAIN or a real public IP address, so the code doesn't match. This is also the old method I mentioned back in the article < a href="https://www.shunot.com/en/192-168-2-1/922.html" > modifying DNS on the optical modem. This time, I also noted "what the normal answers from each provider look like."
Adding multiple comparisons makes it even more stable: asking Alibaba, Tencent, or 114 for the same domain means the IP is resolved normally; If a company reports a completely different address, don't call for hijacking yet. Many large sites have CDNs, and it's normal for different DNS to schedule to different nodes. Two or three IPs are in the same cloud vendor's segment, so it's normal distribution.
Practical Exercise 2: CNAME, MX, TXT—
these tricks are still hanging behind the domain nameChange the -type parameter to see a completely different side of the domain. www.qq.com check, the answer isn't a single line, but a string: first, let's write a CNAME that says www.qq.com is actually an alias for ins-r23tsuuf.ias.tencent-cloud.net; This alias is another CNAME, pointing to tra-kbagmtra.ias.tencent-cloud.net; Only on the third layer did two real IPs appear: 121.14.77.221 and 121.14.77.201. This is the standard structure of a large site—the domain name is attached to the alias' chain, and the innermost layer is the real working server. When switching machines or switching data centers, only the chain tail is moved, while the user-side domain name remains untouched. nslookup lists these lines as they are, Aliases labels aliases, Addresses labels as real IPs.
Check -type=mx qq.com, and the email delivery route will appear: pref=10 mx3.qq.com, pref=30 mx1.qq.com. pref is the priority; the smaller the number, the earlier it is used. The 10th is too busy until the 30th is turned. If you assign your domain name to a corporate email or MX record, check this with a glance.
Checking -type=txt makes it even more interesting. Below my domain name hung a string of garbled text starting with google-site-verification — the verification string left when I proved to the Google webmaster platform that "this domain belongs to me"; qq.com TXT contains a record starting with v = spf1, which is an anti-spam SPF statement informing recipients which servers have the right to send emails in its name. These registry-like records of domain names can all be accessed by nslookup.
Use the exact method for each symptom, and judge accordingly
Incorporate this tool into the troubleshooting process. If the website won't open, first try nslookup for triage: NXDOMAIN is a domain name issue, either you typed it wrong or the other party is really gone; Request timeouts are a channel issue; try switching DNS providers; if it works, it's the previous one's problem; If the resolution is normal but you still can't open it, then it's not related to DNS. Go down and check the network layer. This order is similar to ping. The three-segment positioning is as a partner: one handles "name translation" or "whether the road is open."
| What do you want to know | about | what to check which line |
|---|---|---|
| DNS changed on the router active? Is | there anNSLOOKUP domain? 223.5.5.5 | The answer matches usual and it works |
| rush to answer | ? nslookup whether.114dns.com Each company asks again, | asking to see if the loop code |
| Is the domain really named | nslookup | ?NXDOMAIN or is it timeout |
| Which company is the domain hosted | nslookup -type=ns? Domain | NS records those two |
| lines of why the website changed its IP | nslookup -type=a domain, ask | severalCNAME chains and IP ranges |
Compared to previous articles, I also explained the division of labor: DNS parsing is about the process itself, recursive iteration, and three-layer caching; The cache section is about why the change didn't take effect immediately after the change, and which layer to clear in flushdns; This article focuses on one thing—when you type a command, how do you read each line on the screen? Combining these three articles, you get everything from principles to tools.
