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

Derek Atkins warlord at MIT.EDU
Fri Jul 13 09:28:29 EDT 2012


"Barlow, Jim D" <jim.d.barlow at intel.com> writes:

> 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.

Why not just use DNS views?

Have an "internal DNS" that is only served to your internal hosts, and
then have an "external DNS" that is shown to everyone else?  The
internal view would have your internal addresses, whereas the external
view would only have the external addresses.

> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the Ale mailing list