网络管理器连接中的服务器中有此配置:
/etc/NetworkManager/system-connections/wired-connection
[connection]
id=wired-connection
uuid=0c501f08acc5497cb7...
type=8023ethernet
[8023ethernet]
[ipv4]
method=manual
dns=8.8.8.8;
address1=192.168.1.250/24,192.168.1.1
[ipv6]
method=auto
ip6privacy=0/etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=true但是我的文件/etc/resolv.conf (符号链接)并没有被网络管理器覆盖。如果我手动将行nameserver 8.8.8.8添加到文件中,它可以很好地工作,但它只是一个暂时的解决方案。如果我打开IP配置,在Kubuntu接口中,我会看到DNS字段为空。
我也尝试过使用这个命令,但是它没有运行dpkg-reconfigure resolvconf
我的原始配置文件的路由在/run/resolvconf/resolv.conf中
我找到了这个文件,它属于一个旧的配置/etc/resolvconf/resolv.conf.d/original
nameserver 213.60.205.175
nameserver 213.60.205.174
nameserver 212.51.33.110是否应该删除或编辑此文件以使其正常工作?
我只能远程访问服务器,由于这一点,我想确定这将是可行的。如果没有的话,我就能切断连接
提前感谢
更新03/08/15. /usr/share/resolvconf/dump-debug-info的输出
###### Start of debugging information for resolvconf ######
### ls -l /etc/resolvconf
total 16
-rw-r--r-- 1 root root 172 dic 13 2012 interface-order
drwxr-xr-x 2 root root 4096 jul 8 18:33 resolv.conf.d
drwxr-xr-x 2 root root 4096 jul 8 18:33 update.d
drwxr-xr-x 2 root root 4096 jul 8 19:11 update-libc.d
### cat /etc/resolvconf/interface-order
# interface-order(5)
lo.inet*
lo.dnsmasq
lo.pdnsd
lo.!(pdns|pdns-recursor)
lo
tun*
tap*
hso*
em+([0-9])?(_+([0-9]))*
p+([0-9])p+([0-9])?(_+([0-9]))*
eth*
ath*
wlan*
ppp*
*
### ls -l /etc/resolvconf/resolv.conf.d
total 8
-rw-r--r-- 1 root root 0 dic 13 2012 base
-rw-r--r-- 1 root root 151 dic 13 2012 head
-rw-r--r-- 1 root root 77 jul 8 18:21 original
-rw-r--r-- 1 root root 0 jul 8 18:26 tail
### cat /etc/resolvconf/resolv.conf.d/base
### 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
### cat /etc/resolvconf/resolv.conf.d/original
nameserver 213.60.205.175
nameserver 213.60.205.174
nameserver 212.51.33.110
### cat /etc/resolvconf/resolv.conf.d/tail
### ls -l /etc/resolvconf/run
ls: no se puede acceder a /etc/resolvconf/run: No existe el archivo o el directorio
### ls -l /run/resolvconf
total 4
-rw-r--r-- 1 root root 0 jul 29 10:10 enable-updates
drwxr-xr-x 2 root root 40 jul 29 10:10 interface
-rw-r--r-- 1 root root 151 ago 3 09:40 resolv.conf
### cat /run/resolvconf/enable-updates
### cat /run/resolvconf/resolv.conf
# 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
### ls -l /run/resolvconf/interface
total 0
### ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 29 jul 24 12:59 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
### lsattr /etc/resolv.conf
lsattr: La operación no está soportada Mientras se leían las banderas en /etc/resolv.conf
### cat /etc/resolv.conf
# 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
### cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=true
###### End of debugging information for resolvconf ######顺便说一下,我用的是Kubuntu 14.04
发布于 2015-07-29 13:59:31
您似乎使用的是dnsmasq,它是一个缓存DNS服务器。
如果要添加DNS服务器,可以执行以下命令:
echo nameserver X.X.X.X | sudo resolvconf -a IFACE.PROGNAME
sudo service dnsmasq restart 其中IFACE.PROGNAME是您使用的网络的名称(eth0、eth1、wlan0.)
对于永久的更改,您可以创建一个/etc/rupv.dnsmasq.conf
nameserver 8.8.8.8并编辑/etc/dnsmasq.conf并设置:
resolv-file=/etc/resolv.dnsmasq.conf另一种解决方案是通过注释行来禁用dnsmasq的使用。
dns=dnsmasq在文件/etc/NetworkManager/NetworkManager.conf中。并使用/etc/rupv.conf文件。
发布于 2018-04-11 14:37:23
对我起作用的是启用解析器服务:
sudo systemctl enable resolvconf
sudo reboot问题是在安装了一些VPN垃圾后,没有在启动时启动。
https://askubuntu.com/questions/654208
复制相似问题