/etc/resolv.conf: nameserver 183.60.83.19
nameserver 183.60.82.98
nslookup mirrors.tencentyun.com
169.254.0.3
10.112.65.62
nslookup openapi.tencentyun.com
14.17.52.188
网络环境 | 地域 | 内网 DNS 服务器 |
基础网络 | 广州 | 10.225.30.181
10.225.30.223 |
上海 | 10.236.158.114
10.236.158.106 |
北京 | 10.53.216.182
10.53.216.198 |
上海金融 | 10.48.46.77
10.48.46.27 |
深圳金融 | 100.83.224.91
100.83.224.88 |
北美 | 10.116.19.188
10.116.19.185 |
香港 | 10.243.28.52
10.225.30.178 |
新加坡 | 100.78.90.19
100.78.90.8 |
广州Open | 10.59.218.18
10.112.65.51 |
成都 | 100.88.222.14
100.88.222.16 |
硅谷 | 100.102.22.21
100.102.22.30 |
法兰克福 | 100.120.52.60
100.120.52.61 |
首尔 | 10.165.180.53
10.165.180.62 |
私有网络 | 所有地域 | 183.60.83.19
183.60.82.98 |
具体内容查看命令 systemd-resolve --status 中的“DNS Servers”内容
或者是查看命令 systemctl status resolvconf中的“ExecStartPre”目录
或者是文件
/var/run/systemd/resolve/resolv.conf (ubuntu 20)
/var/run/systemd/resolve/stub-resolv.conf(ubuntu 20)
/var/run/resolvconf/resolv.conf (debian 10)
/var/run/resolvconf/interface/eth0.dhclient (debian 10)
/run/NetworkManager/no-stub-resolv.conf(ubuntu 20)
/etc/resolvconf/resolv.conf.d/base
/var/lib/dhcp/dhclient.eth0.leases
网卡设置文件
/etc/network/interfaces
# cat /etc/network/interfaces.d/50-cloud-init.cfg
allow-hotplug eth0
iface eth0 inet dhcp
NetworkManager自动dns服务器设置的模板 /run/NetworkManager/resolv.conf (临时文件)
/run/NetworkManager/no-stub-resolv.conf (真正的DNS服务器)
# cat /etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
# cat /run/NetworkManager/resolv.conf
# Generated by NetworkManager
search openstacklocal
nameserver 127.0.0.53
# cat /run/NetworkManager/no-stub-resolv.conf
# Generated by NetworkManager
search openstacklocal
nameserver 100.125.1.250
nameserver 100.125.129.250
# systemd-resolve --status
...
Current DNS Server: 100.125.1.250
DNS Servers: 100.125.1.250
100.125.129.250
DNS Domain: ~.
openstacklocal
/# netstat -nap|grep 53
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 447/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 447/systemd-resolve
/etc/dnsmasq.conf
不让NetworkManager改/etc/resolv.conf文件
在/etc/NetworkManager/NetworkManager.conf文件里加
[main]
dns=none
或
rc-manager=unmanaged
或
再 systemctl restart NetworkManager
忽略NetworkManager自动修改的/etc/resolv.conf文件,使用nmcli做设置:
# nmcli device modify eth0 ipv4.ignore-auto-dns yes
或在 /etc/NetworkManager/NetworkManager.conf中 设置为 PEERDNS=no
参考:
https://stackoverflow.com/questions/65922054/remove-dns-from-device-using-nmcli
https://www.golinuxcloud.com/nmcli-command-examples-cheatsheet-centos-rhel/
[
本帖最后由 linda 于 2022-11-3 16:54 编辑 ]