<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto"> I am behind the dhclient-script for past the two days which updates the /etc/resolv.conf. Let me explain the scenario</div><div dir="auto"><br></div><div dir="auto">The dhcp server is sending the ipv6 dhcp nams server to the client. The dhcp server has the name server in the sever conf file as below</div><div dir="auto"><br></div><div dir="auto">subnet6 2001:470:108:4::2/64 {</div><div dir="auto"><br></div><div dir="auto">...........…...................................... </div><div dir="auto"><br></div><div dir="auto">option dhcp6.name-servers 2001:470:108:4::10;</div><div dir="auto"><br></div><div dir="auto">..................................................</div><div dir="auto"><br></div><div dir="auto">}</div><div dir="auto"><br></div><div dir="auto">The dhclient has "dhcp6.name-servers" string under request in dhclient.conf</div><div dir="auto"><br></div><div dir="auto">In dhclient-script under dhcpv6 section the name servers are being updated in /etc/resolv.conf. The default behaviour of the script is to write the new name-servers to the resolv.conf file overwriting the old contents. The overwriting of this file is not acceptable since it is having nameserver IP updated or used by LTE, ethernet in my testing environment.</div><div dir="auto"><br></div><div dir="auto">So I tried to tweak the script a bit by removing the mv command and appending the dhcp6 name servers using echo command directly to resolv.conf than writing to a temp file. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Within the make_resolv_conf function as the last statement I displayed the content of resolv.conf. I executed the dhclient with - 6 and - v enabled. The client fetched the the new ip and print shows the nameserver is appended(cat /etc/resolv.conf)</div><div dir="auto"><br></div><div dir="auto">By default the /etc/resolv.conf content was</div><div dir="auto"><br></div><div dir="auto">nameserver 8.8.8.8</div><div dir="auto">nameserver 8.8.4.4</div><div dir="auto"><br></div><div dir="auto">The print (cat /etc/resolv.conf) showed the content as</div><div dir="auto"><br></div><div dir="auto">namserver <span style="font-family:sans-serif">2001:470:108:4::10</span></div><div dir="auto"><div dir="auto" style="font-family:sans-serif">nameserver 8.8.8.8</div><div dir="auto" style="font-family:sans-serif">nameserver 8.8.4.4</div></div><div dir="auto"><br></div><div dir="auto">Once the dhclient stops successfully I opened the resolv.conf and the new servers were missing. It is having default IPs. What could be the reason for this behaviour.?</div><div dir="auto"><br></div><div dir="auto">Who is refreshing the /etc/resolv.conf. I checked the dhclient-script but couldn't find any clue for this.</div><div dir="auto"><br></div><div dir="auto">To confirm no other process updates the file, I killed the LTE process but the result was same. Other than dhclient-script how the resolv.conf is getting overwritten all the time? What am I missing?</div><div dir="auto"><br></div><div dir="auto">Any help would be much appreciated </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 27 Jul 2020, 5:34 pm Anjali Krishna, <<a href="mailto:krishnaanjali42@gmail.com">krishnaanjali42@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br style="font-family:sans-serif;font-size:medium"><span style="font-family:sans-serif;font-size:medium">Hi </span><div style="font-family:sans-serif;font-size:medium" dir="auto"><br></div><div style="font-family:sans-serif;font-size:medium" dir="auto"> I am using an embedded board with hostname "test_dut"[same under /etc/hostname]. I am testing ipv6 ans ipv4 using dhcpd on server side with - 6, - 4 options and client side I am using dhclient with - 6 and - 4 option for ipv6 and ipv4 respectively. </div><div style="font-family:sans-serif;font-size:medium" dir="auto"> Both the cases Ip assignment is happening without any trouble. But in order to extend our application feature we are providing the information of the connected devices to the user such as mac id, ip, hostname/client name etc. In ipv4 these information are provided under dhcpd.leases file. In case of ipv6 I am not able to find the hostname (test_dut) under the dhcpd6.leases files</div><div style="font-family:sans-serif;font-size:medium" dir="auto"><br></div><div style="font-family:sans-serif;font-size:medium" dir="auto">I tried with adding various options under dhclient.conf such as send host-name "test_dut" and edited the dhclient-script under /sbin and called set_hostname call under bound-renew-reboot section of ipv6. Still the server lease file is not updating the hostname for ipv6 . But hostname is updating for ipv4 connection. </div><div style="font-family:sans-serif;font-size:medium" dir="auto"><br></div><div style="font-family:sans-serif;font-size:medium" dir="auto">How can I resolve this issue? </div><div style="font-family:sans-serif;font-size:medium" dir="auto"><br></div><div style="font-family:sans-serif;font-size:medium" dir="auto">Regards,</div><div style="font-family:sans-serif;font-size:medium" dir="auto">Anjali </div></div>
</blockquote></div>