<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How To: Make Sure /etc/resolv.conf Never Get Updated By DHCP Client</title> <atom:link href="http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Kanda</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-64619</link> <dc:creator>Kanda</dc:creator> <pubDate>Sat, 19 Nov 2011 17:18:34 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-64619</guid> <description>when you run dhclient eth0 chek which file is the correct configuration file
/etc/dhclient.conf
/etc/dhcp3/dhclient.conf
put supersede command in the correct configuration file</description> <content:encoded><![CDATA[<p>when you run dhclient eth0 chek which file is the correct configuration file</p><p>/etc/dhclient.conf<br
/> /etc/dhcp3/dhclient.conf</p><p>put supersede command in the correct configuration file</p> ]]></content:encoded> </item> <item><title>By: Martin</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-60892</link> <dc:creator>Martin</dc:creator> <pubDate>Thu, 21 Jul 2011 04:53:30 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-60892</guid> <description>The stub resolver (built into libc) can&#039;t handle different directions for multiple domains, but you could always point it at a localhost resolver that does.
For that you will need to learn about BIND or LWres or Unbound or some other DNS server, none of which is within the scope of this question.
Having done that you&#039;ll need to be a bit careful what you put in the &quot;search&quot; path; if you put VPN-only zones in it then there may be delays when you don&#039;t have the VPN connected -- not to mention, numerous entries in /var/log/named (or syslog) complaining about the unreachability of the DNS server at the other end of the VPN.</description> <content:encoded><![CDATA[<p>The stub resolver (built into libc) can&#8217;t handle different directions for multiple domains, but you could always point it at a localhost resolver that does.</p><p>For that you will need to learn about BIND or LWres or Unbound or some other DNS server, none of which is within the scope of this question.</p><p>Having done that you&#8217;ll need to be a bit careful what you put in the &#8220;search&#8221; path; if you put VPN-only zones in it then there may be delays when you don&#8217;t have the VPN connected &#8212; not to mention, numerous entries in /var/log/named (or syslog) complaining about the unreachability of the DNS server at the other end of the VPN.</p> ]]></content:encoded> </item> <item><title>By: Michael V. Antosha</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-56316</link> <dc:creator>Michael V. Antosha</dc:creator> <pubDate>Mon, 14 Mar 2011 13:45:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-56316</guid> <description>Option # 3 needs correction I think.
In my case there was not dhclient.conf file and I created an empty one with the line you proposed:
option domain-name-servers a.b.c.d
Nothing changed in behaviour and there was an error in logs when dhclient started:
...dhclient: /etc/dhclient.conf line 2: expecting &quot;code&quot; keyword.
Finally this worked for me (choose one of those):
supersede domain-name-servers 8.8.8.8;
or
prepend domain-name-servers a.b.c.d;
&#039;prepend&#039; does not replace DNS servers obtained by DHCP, but this makes your name server to be the first one in resolv.conf
&#039;supersede&#039; totally replaces the option with your variant.
I hope this will help someone.
Michael.</description> <content:encoded><![CDATA[<p>Option # 3 needs correction I think.</p><p>In my case there was not dhclient.conf file and I created an empty one with the line you proposed:<br
/> option domain-name-servers a.b.c.d</p><p>Nothing changed in behaviour and there was an error in logs when dhclient started:<br
/> &#8230;dhclient: /etc/dhclient.conf line 2: expecting &#8220;code&#8221; keyword.</p><p>Finally this worked for me (choose one of those):<br
/> supersede domain-name-servers 8.8.8.8;<br
/> or<br
/> prepend domain-name-servers a.b.c.d;</p><p>&#8216;prepend&#8217; does not replace DNS servers obtained by DHCP, but this makes your name server to be the first one in resolv.conf<br
/> &#8216;supersede&#8217; totally replaces the option with your variant.</p><p>I hope this will help someone.</p><p>Michael.</p> ]]></content:encoded> </item> <item><title>By: Ron</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-55254</link> <dc:creator>Ron</dc:creator> <pubDate>Sun, 30 Jan 2011 11:40:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-55254</guid> <description>Hi all,
When i use a vpn to my work i want the dns servers from my work to be used for queries to the local domain.
Is there a way to point the client to a specific dns server for domain
&quot;mywork.local&quot; ? When i connect the vpn resolv.conf does not get rewritten with the mywork dns servers...
I use ubuntu 10.10 desktop edition</description> <content:encoded><![CDATA[<p>Hi all,<br
/> When i use a vpn to my work i want the dns servers from my work to be used for queries to the local domain.</p><p>Is there a way to point the client to a specific dns server for domain<br
/> &#8220;mywork.local&#8221; ? When i connect the vpn resolv.conf does not get rewritten with the mywork dns servers&#8230;</p><p>I use ubuntu 10.10 desktop edition</p> ]]></content:encoded> </item> <item><title>By: lifeofguenter</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-51235</link> <dc:creator>lifeofguenter</dc:creator> <pubDate>Wed, 01 Dec 2010 15:05:31 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-51235</guid> <description>In Debian Lenny (5.0) you should do this:
# nano /etc/default/dhcpcd
(...)
# Uncomment this to allow dhcpcd to set the DNS servers in /etc/resolv.conf
# If you are using resolvconf then you can leave this commented out.
SET_DNS=&#039;no&#039;
# Uncomment this to allow dhcpcd to set hostname of the host to the
# hostname option supplied by DHCP server.
SET_HOSTNAME=&#039;no&#039;
(...)</description> <content:encoded><![CDATA[<p>In Debian Lenny (5.0) you should do this:</p><p># nano /etc/default/dhcpcd<br
/> (&#8230;)<br
/> # Uncomment this to allow dhcpcd to set the DNS servers in /etc/resolv.conf<br
/> # If you are using resolvconf then you can leave this commented out.<br
/> SET_DNS=&#8217;no&#8217;</p><p># Uncomment this to allow dhcpcd to set hostname of the host to the<br
/> # hostname option supplied by DHCP server.<br
/> SET_HOSTNAME=&#8217;no&#8217;<br
/> (&#8230;)</p> ]]></content:encoded> </item> <item><title>By: Peter</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-46688</link> <dc:creator>Peter</dc:creator> <pubDate>Thu, 01 Apr 2010 15:28:25 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-46688</guid> <description>For RHEL/CentOS the right way to solve this problem is to update /etc/sysconfig/network-scripts/ifcfg-eth0 or whatever interface you have, with:
PEERDNS=no
PEERNTP=no # if you have also problem with overwritten /etc/ntp.conf
check documentation at /usr/share/doc/initscripts-*/sysconfig.txt
or see whats inside script causing all this /sbin/dhclient-script , search for PEER</description> <content:encoded><![CDATA[<p>For RHEL/CentOS the right way to solve this problem is to update /etc/sysconfig/network-scripts/ifcfg-eth0 or whatever interface you have, with:<br
/> PEERDNS=no<br
/> PEERNTP=no # if you have also problem with overwritten /etc/ntp.conf</p><p>check documentation at /usr/share/doc/initscripts-*/sysconfig.txt<br
/> or see whats inside script causing all this /sbin/dhclient-script , search for PEER</p> ]]></content:encoded> </item> <item><title>By: ozgur</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-46441</link> <dc:creator>ozgur</dc:creator> <pubDate>Mon, 15 Mar 2010 19:27:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-46441</guid> <description>Thanks for the help, that did not fix the problem but then I tried using supersede command instead of option, and now it works</description> <content:encoded><![CDATA[<p>Thanks for the help, that did not fix the problem but then I tried using supersede command instead of option, and now it works</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-46367</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Thu, 11 Mar 2010 18:55:06 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-46367</guid> <description>Follow option # 3, this should fix it.</description> <content:encoded><![CDATA[<p>Follow option # 3, this should fix it.</p> ]]></content:encoded> </item> <item><title>By: ozgur</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-46366</link> <dc:creator>ozgur</dc:creator> <pubDate>Thu, 11 Mar 2010 18:27:10 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-46366</guid> <description>My OS is kubuntu 9.10 x64. I have followed the procedure described in the 2nd Option, but it didn&#039;t work.. resolv.conf is still being set to its original state everytime I reboot my system. Any of you can help me about it?</description> <content:encoded><![CDATA[<p>My OS is kubuntu 9.10 x64. I have followed the procedure described in the 2nd Option, but it didn&#8217;t work.. resolv.conf is still being set to its original state everytime I reboot my system. Any of you can help me about it?</p> ]]></content:encoded> </item> <item><title>By: korhan</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-45982</link> <dc:creator>korhan</dc:creator> <pubDate>Tue, 16 Feb 2010 01:07:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-45982</guid> <description>At least on the BSD variants, the problem occurs when &lt;i&gt;/sbin/dhclient-script&lt;/i&gt; is called by &lt;i&gt;/sbin/dhclient&lt;/i&gt;. You could conceivably edit this script to ensure that &lt;i&gt;/etc/resolv.conf&lt;/i&gt; does not get overwritten, but I find using the &lt;i&gt;supersede&lt;/i&gt; directive works well enough. You would edit &lt;i&gt;/etc/dhclient.conf&lt;/i&gt; as follows:
supersede host-name &quot;myhost&quot;;
supersede domain-name &quot;my.domain&quot;;
supersede domain-name-servers 127.0.0.1,192.168.1.1,192.168.1.2;
Which will give generate the following &lt;i&gt;/etc/resolv.conf&lt;/i&gt; for you every time:
search mydomain
nameserver 127.0.0.1
nameserver 192.168.1.1
nameserver 192.168.1.2
There really should be a more obvious way to stop this often unwanted behavior.
Thanks for the information - you helped solve this irritating little problem for me.</description> <content:encoded><![CDATA[<p>At least on the BSD variants, the problem occurs when <i>/sbin/dhclient-script</i> is called by <i>/sbin/dhclient</i>. You could conceivably edit this script to ensure that <i>/etc/resolv.conf</i> does not get overwritten, but I find using the <i>supersede</i> directive works well enough. You would edit <i>/etc/dhclient.conf</i> as follows:</p><p>supersede host-name &#8220;myhost&#8221;;<br
/> supersede domain-name &#8220;my.domain&#8221;;<br
/> supersede domain-name-servers 127.0.0.1,192.168.1.1,192.168.1.2;</p><p>Which will give generate the following <i>/etc/resolv.conf</i> for you every time:</p><p>search mydomain<br
/> nameserver 127.0.0.1<br
/> nameserver 192.168.1.1<br
/> nameserver 192.168.1.2</p><p>There really should be a more obvious way to stop this often unwanted behavior.</p><p>Thanks for the information &#8211; you helped solve this irritating little problem for me.</p> ]]></content:encoded> </item> <item><title>By: yannis t</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-45235</link> <dc:creator>yannis t</dc:creator> <pubDate>Sun, 20 Dec 2009 02:26:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-45235</guid> <description>if you want local values to supersede server values add in /etc/dhclient3/dhclient3.conf
supersede domain-name &quot;google.com&quot;</description> <content:encoded><![CDATA[<p>if you want local values to supersede server values add in /etc/dhclient3/dhclient3.conf<br
/> supersede domain-name &#8220;google.com&#8221;</p> ]]></content:encoded> </item> <item><title>By: eli</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-43770</link> <dc:creator>eli</dc:creator> <pubDate>Mon, 21 Sep 2009 20:40:13 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-43770</guid> <description>Thanks so much for this. It&#039;s been driving me crazy trying to keep resolv.conf from being changed.</description> <content:encoded><![CDATA[<p>Thanks so much for this. It&#8217;s been driving me crazy trying to keep resolv.conf from being changed.</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-38754</link> <dc:creator>vivek</dc:creator> <pubDate>Fri, 12 Sep 2008 04:19:14 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-38754</guid> <description>James,
Thanks for your feedback. The faq has been updated.</description> <content:encoded><![CDATA[<p>James,</p><p>Thanks for your feedback. The faq has been updated.</p> ]]></content:encoded> </item> <item><title>By: James</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-38753</link> <dc:creator>James</dc:creator> <pubDate>Fri, 12 Sep 2008 03:02:26 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-38753</guid> <description>Note:  You are making a big assumption, that being that the user is using ext3.  Yes RH and derivatives force this on you.  Other linux distro&#039;s recognize the other files systems where chattr is not going to be available.
Take a look at the man page for dhclient.conf (used by dhclient3 btw)
********snip*********
The supersede statement
supersede [ option declaration ] ;
If for some option the client should always use a locally-configured  value  or  values  rather  than
whatever is supplied by the server, these values can be defined in the supersede statement.
*******end snip ***********</description> <content:encoded><![CDATA[<p>Note:  You are making a big assumption, that being that the user is using ext3.  Yes RH and derivatives force this on you.  Other linux distro&#8217;s recognize the other files systems where chattr is not going to be available.</p><p>Take a look at the man page for dhclient.conf (used by dhclient3 btw)</p><p>********snip*********</p><p> The supersede statement</p><p> supersede [ option declaration ] ;</p><p> If for some option the client should always use a locally-configured  value  or  values  rather  than<br
/> whatever is supplied by the server, these values can be defined in the supersede statement.</p><p>*******end snip ***********</p> ]]></content:encoded> </item> <item><title>By: Lacey</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-38733</link> <dc:creator>Lacey</dc:creator> <pubDate>Wed, 10 Sep 2008 02:04:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-38733</guid> <description>resolvconf will append whatever&#039;s in your resolvconf files (head, base, tail), but I haven&#039;t figured out a way to stop it from including the DHCP stuff as well, which I don&#039;t want.  I will try write-protecting /etc/resolv.conf to see if that works.</description> <content:encoded><![CDATA[<p>resolvconf will append whatever&#8217;s in your resolvconf files (head, base, tail), but I haven&#8217;t figured out a way to stop it from including the DHCP stuff as well, which I don&#8217;t want.  I will try write-protecting /etc/resolv.conf to see if that works.</p> ]]></content:encoded> </item> <item><title>By: matias</title><link>http://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/#comment-38728</link> <dc:creator>matias</dc:creator> <pubDate>Tue, 09 Sep 2008 05:14:24 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/?p=1647#comment-38728</guid> <description>in Debian &amp; *ubuntus resolv.conf is handled by a package called resolvconf. You should modify resolv.conf through it.</description> <content:encoded><![CDATA[<p>in Debian &amp; *ubuntus resolv.conf is handled by a package called resolvconf. You should modify resolv.conf through it.</p> ]]></content:encoded> </item> </channel> </rss>
