dhclient hook not overwritten /etc/resolv.conf

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dhclient hook not overwritten /etc/resolv.conf

Zhengyu Pan(联通集团联通云数据有限公司本部)
Hi,

My OS is Centos7. I add a bash script dns.sh in /etc/dhcp/dhclient-exit-hooks.d . The script content is

#!/bin/bash
echo nameserver 2400:da00::6666 >> /etc/resolv.conf

I want to append a Ipv6 nameserver in /etc/resolv.conf.
However, when I restart network. /etc/resove.conf not changed.
/etc/resolv.conf.save append this line. 
Why happens that? How can I append a nameserver in /etc/resove.conf?

Zhengyu
Best Wishes
如果您错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到 [hidden email],即可以退订此邮件。我们将立即将您的信息从我们的发送目录中删除。 If you have received this email in error please notify us immediately by e-mail. Please reply to [hidden email] ,you can unsubscribe from this mail. We will immediately remove your information from send catalogue of our.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhclient hook not overwritten /etc/resolv.conf

Pavel Zhukov
Hello,

Does the hook have executable flag set?

On Thu, Dec 19, 2019 at 1:36 PM Zhengyu Pan(联通集团联通云数据有限公司本部)
<[hidden email]> wrote:

>
> Hi,
>
> My OS is Centos7. I add a bash script dns.sh in /etc/dhcp/dhclient-exit-hooks.d . The script content is
>
> #!/bin/bash
> echo “nameserver 2400:da00::6666” >> /etc/resolv.conf
>
> I want to append a Ipv6 nameserver in /etc/resolv.conf.
> However, when I restart network. /etc/resove.conf not changed.
> /etc/resolv.conf.save append this line.
> Why happens that? How can I append a nameserver in /etc/resove.conf?
>
> Zhengyu
> Best Wishes
> 如果您错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到 [hidden email],即可以退订此邮件。我们将立即将您的信息从我们的发送目录中删除。 If you have received this email in error please notify us immediately by e-mail. Please reply to [hidden email] ,you can unsubscribe from this mail. We will immediately remove your information from send catalogue of our.
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users



--
Pavel Zhukov
Software Engineer
IRC: landgraf
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: dhclient hook not overwritten /etc/resolv.conf

Zhengyu Pan(联通集团联通云数据有限公司本部)
Yes, the hook has executable flag set.  But it written to /etc/resolv.conf.save.

Zhengyu
Thanks.

> 2019年12月19日 下午9:49,Pavel Zhukov <[hidden email]> 写道:
>
> Hello,
>
> Does the hook have executable flag set?
>
> On Thu, Dec 19, 2019 at 1:36 PM Zhengyu Pan(联通集团联通云数据有限公司本部)
> <[hidden email]> wrote:
>>
>> Hi,
>>
>> My OS is Centos7. I add a bash script dns.sh in /etc/dhcp/dhclient-exit-hooks.d . The script content is
>>
>> #!/bin/bash
>> echo “nameserver 2400:da00::6666” >> /etc/resolv.conf
>>
>> I want to append a Ipv6 nameserver in /etc/resolv.conf.
>> However, when I restart network. /etc/resove.conf not changed.
>> /etc/resolv.conf.save append this line.
>> Why happens that? How can I append a nameserver in /etc/resove.conf?
>>
>> Zhengyu
>> Best Wishes
>> 如果您错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到 [hidden email],即可以退订此邮件。我们将立即将您的信息从我们的发送目录中删除。 If you have received this email in error please notify us immediately by e-mail. Please reply to [hidden email] ,you can unsubscribe from this mail. We will immediately remove your information from send catalogue of our.
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
>
> --
> Pavel Zhukov
> Software Engineer
> IRC: landgraf
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

如果您错误接收了该邮件,请通过电子邮件立即通知我们。请回复邮件到 [hidden email],即可以退订此邮件。我们将立即将您的信息从我们的发送目录中删除。 If you have received this email in error please notify us immediately by e-mail. Please reply to [hidden email] ,you can unsubscribe from this mail. We will immediately remove your information from send catalogue of our.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users