Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
静态IP设置为在beagle bone上持久化Angstrom Linux的dns名称服务器_Linux_Static_Dns_Ip - Fatal编程技术网

静态IP设置为在beagle bone上持久化Angstrom Linux的dns名称服务器

静态IP设置为在beagle bone上持久化Angstrom Linux的dns名称服务器,linux,static,dns,ip,Linux,Static,Dns,Ip,我在运行angstrom版本linux的beaglebone上持久化我的名称服务器和域时遇到问题。我已尝试编辑我的/etc/resolv.conf文件以包含: domain xx.xx.xx.xx nameserver xx.xx.xx.xx 当我重新启动时,这个文件会被覆盖,并且是空白的。我还尝试输入/etc/network/interfaces文件: auto eth0 iface eth0 inet static address xx.xx.xx.xx netmask xx.xx

我在运行angstrom版本linux的beaglebone上持久化我的名称服务器和域时遇到问题。我已尝试编辑我的/etc/resolv.conf文件以包含:

domain xx.xx.xx.xx
nameserver xx.xx.xx.xx
当我重新启动时,这个文件会被覆盖,并且是空白的。我还尝试输入/etc/network/interfaces文件:

auto eth0
iface eth0 inet static
  address xx.xx.xx.xx
  netmask xx.xx.xx.xx
  gateway xx.xx.xx.xx
  dns-nameservers xx.xx.xx.xx
重新启动后,这对我也不起作用。为什么会覆盖resolv.conf?如何持久保存这些值,以便在设备重新启动时使用我输入的新值


谢谢

遇到同样的问题,有几个修复方法。 长话短说:Connman管理您的网络,并在您重新启动时覆盖/etc/resolv.conf

可能的修复方法:使用connman设置名称服务器


轻松修复:将nameserver添加到resolv.conf,并防止resolv.conf被修改
chattr+i/etc/resolv.conf
(使用root)

虽然该线程的标题提到Angstrom,但该问题也适用于debian。核心问题实际上与连接管理器管理IP内容有关。如果键入:

cat /etc/resolv.conf
请参阅:

#由连接管理器生成

为了方便您自己,请使用连接管理器[facepalm]。使用超级用户:

su
connmanctl services
您将看到列出的几个服务。寻找一个类似于:

以太网电缆04a316afa8e2

仍然使用超级用户,键入(将“ethernet”和“cable”之间的十六进制替换为特定的十六进制字符串:

connmanctl config ethernet_04a316afa8e2_cable --nameservers 8.8.8.8
cat /etc/resolv.conf