<p><br> On Mar 8, 2013 5:27 AM, "Alan McKinnon" <<a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a>> wrote:<br> ><br> > Anyone know if there's a way to get /etc/hosts to support the notion of<br> > an include file? I did my homework and found nothing, maybe someone else<br> > knows more.<br> ><br> > I really do need this, I have an app that discovers things on the<br> > network and knows their address. This makes it's automated way into DNS<br> > but takes a few days, and another app needs to use the fqdn right now.<br> > So /etc/hosts is the way to go for the interim three days.<br> ><br> > I've worked around it by creating /etc/hosts.d/ containing a header and<br> > a data file. cat the two and redirect to /etc/hosts.d/hosts and the real<br> > hosts file is a symlink to that. It's a sub-directory as none of these<br> > apps run as root and only root can modiy the real hosts file.<br> ><br> > This works well enough, but a supported include mechanism would make<br> > life so much simpler, not to mention easier for my colleagues to<br> > understand what the blazes I set up :-)<br> ><br> ><br> ><br> > --<br> > Alan McKinnon<br> > <a href="mailto:alan.mckinnon@gmail.com">alan.mckinnon@gmail.com</a><br> ><br> ><br> ></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's script location</p> <p>Besides, you said you'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>