Ubuntu 16.04出现DNS_PROBE_FINISHED_NXDOMAIN错误,求稳定修复方法
Hey there, let's tackle this DNS issue together—no need to switch back to Windows, we'll get your Ubuntu 16.04 online smoothly. Since your Windows 10 laptop and Ubuntu 13.10 live CD work fine on the same router, the problem is almost certainly with your Ubuntu 16.04's DNS or network configuration, not your hardware or router. Here are step-by-step fixes, ordered from easiest to most thorough:
1. Flush Your Local DNS Cache
Sometimes stale DNS data causes this error. Let's clear it out quickly:
- Open the Terminal (press
Ctrl+Alt+T—this is your go-to tool for quick Linux commands) - Run this command (type it exactly, then press Enter):
sudo systemd-resolve --flush-caches - When prompted, enter your user password (you won't see characters as you type—this is normal for Linux, don't worry)
- Try opening a web browser again to see if the error is gone.
2. Manually Set Reliable Public DNS Servers
If your system is picking up a broken DNS server from your router, switching to a trusted public DNS should fix it. Popular, stable options include Google's 8.8.8.8/8.8.4.4 or domestic Chinese DNS 114.114.114.114/114.114.115.115:
- Click the network icon in the top-right corner (looks like a Wi-Fi symbol or Ethernet cable)
- Select Edit Connections...
- In the window that pops up, find your active network (wired or wireless), select it, then click Edit
- Go to the IPv4 Settings tab
- Change the Method dropdown to Automatic (DHCP) addresses only
- In the DNS servers field, type one of these pairs (comma-separated):
8.8.8.8,8.8.4.4(Google's global DNS)114.114.114.114,114.114.115.115(Domestic Chinese DNS, great for local sites)
- Click Save, then disconnect and reconnect your network. Test your browser again.
3. Restart the Network Manager
If the above steps don't work, resetting the network service can fix random glitches:
- Open the Terminal again
- Run this command:
sudo service network-manager restart - Wait a few seconds for the network to reconnect, then check if you can access websites.
4. Check for Hosts File Tampering (Rare but Possible)
Occasionally, a modified hosts file can block domain resolutions. Let's verify it's in good shape:
- In the Terminal, run:
sudo nano /etc/hosts - You'll see a file with lines like this (your computer name might differ):
127.0.0.1 localhost 127.0.1.1 my-ubuntu-pc ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters - If there are any extra lines with random domains or IPs, delete them using the Delete key
- Press
Ctrl+Oto save the file, thenCtrl+Xto exit the editor - Restart the Network Manager with the command from Step 3 and test again.
内容的提问来源于stack exchange,提问作者Ronnie McKenna

