<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vacmf &#187; dhcp</title>
	<atom:link href="http://vacmf.org/tag/dhcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://vacmf.org</link>
	<description>there's more than one way to do it</description>
	<lastBuildDate>Sun, 05 Sep 2010 16:15:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to prevent DHCP server to override your resolv.conf script</title>
		<link>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/</link>
		<comments>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 10:49:50 +0000</pubDate>
		<dc:creator>shima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dhcp client]]></category>
		<category><![CDATA[resolv.conf]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/</guid>
		<description><![CDATA[Draft The &#8220;problem&#8221; is caused by dhcp server that overwrite our resolv.conf script and we lose this personalization during the IP release session. Not even is a good idea to replace the dns configuration proposed by the dhcp server, if it push that to you, probably there is a reason. But some time you want]]></description>
			<content:encoded><![CDATA[<p><em>Draft</em></p>
<p>The &#8220;problem&#8221; is caused by dhcp server that overwrite our resolv.conf script and we lose this personalization during the IP release session. Not even is a good idea to replace the dns configuration proposed by the dhcp server, if it push that to you, probably there is a reason. But some time you want to use your own configuration such as when you use your broadband router and you want your /etc/resolv.conf has been preserved fron updates.</p>
<p>To prevent  this nasty situation we can operate in two ways, determined by which dhcp client you are using: dhcpcd ord dhclient.</p>
<p>In the first case, dhcpcd (as in my Slackware laptop), prevent overriding can be obtained simply add the -R option to the dhcpcd command:</p>
<pre># dhcpcd -R eth0</pre>
<p>In the second case, we must read the man page about dhclient-script which is invoked any time you use dhclient.<br />
In:</p>
<pre>man 8 dhclient-script</pre>
<p>at the HOOKS section we can read:</p>
<blockquote><p>HOOKS</p>
<p>When it starts, the client script first defines a shell function, <strong>make_resolv_conf ,</strong> which is later used to create the <strong>/etc/resolv.conf</strong> file. To override the default behaviour, redefine this function in the enter hook script.</p></blockquote>
<p>This means that we must to create /etc/dhclient-enter-hooks and  redefine the make_resolv_conf function to satisfy our needs.<br />
If we simply wants to prevent resolv.conf updates only, the fastest way is to redefine the function to do nothing:</p>
<pre># cat /etc/dhclient-enter-hooks
make_resolv_conf() {
exit 0
}</pre>
<p>Then save the file and ensure it is executable:</p>
<pre># chmod a+x /etc/dhclient-enter-hooks</pre>
<p>Note that, as explained in the man page, the dhclient-script is not standard so if this configuration doesn&#8217;t work, please read the man page.</p>
<p>Next: How to merge dns addresses pushed by the dhcp server and my own dns.</p>
]]></content:encoded>
			<wfw:commentRss>http://vacmf.org/2006/12/20/how-to-prevent-dhcp-server-to-override-your-resolvconf-script/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
