ILD

resolvconf
作者:Yuan Jianpeng 邮箱:yuanjp89@163.com
发布时间:2020-8-16 站点:Inside Linux Development

resolvconf - manage nameserver information


语法

cat FILE | resolvconf -a IFACE.PROG

resolvconf -d IFACE.PROG

resolvconf -u

resolvconf --enable-updates | --disable-update | --updates-are-enabled


resolconf包括一个运行时dns信息的简单数据库,以及一个简单的通知框架。信息使用resolvconf程序添加数据库,或从数据库中删除。


接收通知的服务应该在/etc/resolvconf/update.d安装它的脚本。


libc是resolvconf最重要的订阅者。对应的脚本/etc/resolvconf/update.d/libc。它产生一个新版的文件/run/resolvconf/resolv.conf,如果和老的文件发生变化,则/etc/resolvconf/update-libc.d/下面的hook被执行。


/etc/resolv.conf 通常是一个指向/run/resolvconf/resolv.conf的符号链接


选项:

-a IFACE.PROG,添加或覆盖IFACE.PROG的记录,如果updating是开启的话,执行update脚本。resolvconf从标准输入读取记录,以resolv.conf的格式,每一行必须以换行符结束。


-d IFACE.PROG,删除IFACE.PROG记录


-u 执行更新脚本。


-a/-d/-u

如果updating没有开启,则调度一个delayed update,在update开启的时候执行。


--enable-updates

设置enable标志,如果有delayed update,则执行update脚本。


--disable-updates

清除标志


--updates-are-enabled

如果开启返回0,否则返回1





参考

man 8 resolvconf

Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.