<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thanks.
<div class="">I have tried append prepend and supersede option. They are ok for ipv4 name server. But It doesn’t work for ipv6 name server.
<div class=""><br class="">
</div>
<div class="">Zhengyu<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">2019年12月19日 下午6:16,Philippe Maechler <<a href="mailto:pmaechler-ml@glattnet.ch" class="">pmaechler-ml@glattnet.ch</a>> 写道:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">Hi Zhengyu Pan<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">Have you tried to put this nameserver address in dhclient.conf?<span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">From man dhclient.conf<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">     append { [option declaration] [, ... option declaration] }<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             If for some set of options the client should first use the values<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             supplied by the server, if any, and then use values you supply,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             these values can be defined in the append statement.  The append<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             statement can only be used for options which allow more than one<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             value to be given.  This restriction is not enforced - if you<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt; font-family: "Courier New";" class="">             ignore it, the behaviour will be unpredictable.<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">I haven’t use the ap- or prepend options, but the supersede option work like a charm (at least on FreeBSD)<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">/BR<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-GB" style="font-size: 12pt;" class="">Philippe<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Arial, sans-serif;" class=""><o:p class=""> </o:p></span></div>
<div class="">
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<b class=""><span lang="EN-GB" class="">From:</span></b><span lang="EN-GB" class=""><span class="Apple-converted-space"> </span>bind-users <<a href="mailto:bind-users-bounces@lists.isc.org" class="">bind-users-bounces@lists.isc.org</a>><span class="Apple-converted-space"> </span><b class="">On
 Behalf Of<span class="Apple-converted-space"> </span></b>Zhengyu Pan(???????????????)<br class="">
</span><b class=""><span lang="DE" class="">Sent:</span></b><span lang="DE" class=""><span class="Apple-converted-space"> </span>Thursday, December 19, 2019 10:01 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:bind-users@lists.isc.org" class="">bind-users@lists.isc.org</a><br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>dhclient hook not overwritten /etc/resolv.conf<o:p class=""></o:p></span></div>
</div>
</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm; background-color: rgb(252, 252, 252); background-position: initial initial; background-repeat: initial initial;" class="">Hi,</span></span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm; background-color: rgb(252, 252, 252); background-position: initial initial; background-repeat: initial initial;" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm; background-color: rgb(252, 252, 252); background-position: initial initial; background-repeat: initial initial;" class="">My OS is
 Centos7. I add a bash script dns.sh in /etc/dhcp/dhclient-exit-hooks.d . The script content is</span></span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm; background-color: rgb(252, 252, 252); background-position: initial initial; background-repeat: initial initial;" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm; background-color: rgb(252, 252, 252); background-position: initial initial; background-repeat: initial initial;" class="">#!/bin/bash</span></span><o:p class=""></o:p></div>
</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">echo</span></span><span class="crayon-h"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class=""><span class="Apple-converted-space"> </span></span></span><span style="font-size: 10.5pt; font-family: "Courier New"; background-color: rgb(250, 250, 250); background-position: initial initial; background-repeat: initial initial;" class="">“</span><span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">nameserver</span></span><span class="crayon-h"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class=""><span class="Apple-converted-space"> </span></span></span><span class="crayon-cn"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">1.1.1.1</span></span><span style="font-size: 10.5pt; font-family: "Courier New"; background-color: rgb(250, 250, 250); background-position: initial initial; background-repeat: initial initial;" class="">”</span><span class="crayon-h"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class=""><span class="Apple-converted-space"> </span></span></span><span class="crayon-o"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">>></span></span><span class="crayon-h"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class=""><span class="Apple-converted-space"> </span></span></span><span class="crayon-o"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">/</span></span><span class="crayon-v"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">etc</span></span><span class="crayon-o"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">/</span></span><span class="crayon-v"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">resolv</span></span><span class="crayon-sy"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">.</span></span><span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">conf</span></span><o:p class=""></o:p></div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">I want to append a nameserver in /etc/resove.conf.</span></span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="crayon-i"><span style="font-size: 10.5pt; font-family: "Courier New"; border: 1pt none windowtext; padding: 0cm;" class="">However, when I restart network.<span class="Apple-converted-space"> </span></span></span><span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class="">/etc/resove.conf
 not changed.</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class="">/etc/resove.conf.save append this line. </span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class="">Why happens that? How can I append a nameserver in /etc/resove.conf?</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class="">Zhengyu</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10.5pt; font-family: "Courier New"; color: rgb(34, 34, 34);" class="">Best Wishes</span><o:p class=""></o:p></div>
</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-family: "MS Gothic";" class="">如果您</span><span style="font-family: "Microsoft JhengHei", sans-serif;" class="">错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到</span> <a href="mailto:hqs-spmc@chinaunicom.cn%EF%BC%8C%E5%8D%B3%E5%8F%AF%E4%BB%A5%E9%80%80%E8%AE%A2%E6%AD%A4%E9%82%AE%E4%BB%B6%E3%80%82%E6%88%91%E4%BB%AC%E5%B0%86%E7%AB%8B%E5%8D%B3%E5%B0%86%E6%82%A8%E7%9A%84%E4%BF%A1%E6%81%AF%E4%BB%8E%E6%88%91%E4%BB%AC%E7%9A%84%E5%8F%91%E9%80%81%E7%9B%AE%E5%BD%95%E4%B8%AD%E5%88%A0%E9%99%A4" style="color: purple; text-decoration: underline;" class="">hqs-spmc@chinaunicom.cn<span style="font-family: "MS Gothic";" class="">,即可以退</span><span style="font-family: "Microsoft JhengHei", sans-serif;" class="">订此邮件。我们将立即将您的信息从我们的发送目录中删除</span></a><span style="font-family: "Microsoft JhengHei", sans-serif;" class="">。</span><span class="Apple-converted-space"> </span>If
 you have received this email in error please notify us immediately by e-mail. Please reply to <a href="mailto:hqs-spmc@chinaunicom.cn" style="color: purple; text-decoration: underline;" class="">hqs-spmc@chinaunicom.cn</a> ,you can unsubscribe from this mail.
 We will immediately remove your information from send catalogue of our.<span class="Apple-converted-space"> </span></div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
如果您错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到 hqs-spmc@chinaunicom.cn,即可以退订此邮件。我们将立即将您的信息从我们的发送目录中删除。 If you have received this email in error please notify us immediately by e-mail. Please reply to hqs-spmc@chinaunicom.cn ,you can unsubscribe from this mail. We will immediately
 remove your information from send catalogue of our.
</body>
</html>