<p><br>
On Mar 8, 2013 5:27 AM, &quot;Alan McKinnon&quot; &lt;<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Anyone know if there&#39;s a way to get /etc/hosts to support the notion of<br>
&gt; an include file? I did my homework and found nothing, maybe someone else<br>
&gt; knows more.<br>
&gt;<br>
&gt; I really do need this, I have an app that discovers things on the<br>
&gt; network and knows their address. This makes it&#39;s automated way into DNS<br>
&gt; but takes a few days, and another app needs to use the fqdn right now.<br>
&gt; So /etc/hosts is the way to go for the interim three days.<br>
&gt;<br>
&gt; I&#39;ve worked around it by creating /etc/hosts.d/ containing a header and<br>
&gt; a data file. cat the two and redirect to /etc/hosts.d/hosts and the real<br>
&gt; hosts file is a symlink to that. It&#39;s a sub-directory as none of these<br>
&gt; apps run as root and only root can modiy the real hosts file.<br>
&gt;<br>
&gt; This works well enough, but a supported include mechanism would make<br>
&gt; life so much simpler, not to mention easier for my colleagues to<br>
&gt; understand what the blazes I set up :-)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Alan McKinnon<br>
&gt; <a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a><br>
&gt;<br>
&gt;<br>
&gt;</p>
<p>An option would be to create a cron job which generates the hosts file every minute. The cron job should also insert a header on top of the hosts file telling:</p>
<p>+ this file (hosts) is dynamically generated<br>
+ by a system cron job<br>
+ the cron job&#39;s script location</p>
<p>Besides, you said you&#39;re going to need this workaround only for a couple of days, so installing Samba4 might be an overkill.<br>
   </p>
<p>Rgds,<br>
--<br>
</p>