[ale] is there a bash command to include a file in /etc/hosts?

Barlow, Jim D jim.d.barlow at intel.com
Thu Jul 12 16:36:20 EDT 2012


Wolf Halton wrote:

> Exactly.
> I want to use a variation on DNS that lets me name my internal machines the same names as their FQDN so that the machines work with each other exactly how they work with hosts outside my private network.  One of the rules the firewall admins require is that one > host in the private range may not send packets out through the firewall that will eventually loop back through the firewall to another host on the internal network.
> Yes, I can just add a host to the /etc/hosts file that has "192.168.0.23 wolfhalton.info" as the recipient's IP mapping, but I wanted to have a file I could drop into any of my local machines with the local info, so if I want to make changes in the internal networking, I can
> > just change the file and distribute it where it is needed.  Keeps the hosts file uncluttered.  I can also map IPs to non-authentic FQDNs like cat.fish, dog.fish and so on with this scheme, if I want to.  I cannot distribute the names to my nameservers so nobody external > will be able to find http://cat.fish.  
>The other option that might work is to modify the resolv system so it looks for hosts and hosts2 before looking for a DNS service.
>I don't want to start making IPTables rules or adding to hosts.allow and hosts.deny.

Here is another option:    puppet     

Puppet is in the EPEL repository.   I use it to maintain the /etc/hosts file on anything below the localhost lines.    It does a nice job of adding / deleting / changing your file.



More information about the Ale mailing list