[Nottingham] Two Entries in /etc/hosts

Martin martin at ml1.co.uk
Thu Apr 28 12:29:06 UTC 2016

On 28/04/16 13:21, Jason Irwin wrote:
> "hostname" sets the name of the PC itself. Based on your previous
> reply, I assumed needed to do that too for some reason.
> As I said, you really don't want to be dynamically updating
> "/etc/hosts" if you can avoid it.
> Consider updating your dnsmasq/bind9 config files instead.
> In fact, for dnsmasq, I am pretty sure you could switch between a
> "home" config and an "away" config. Not tried it myself.
> Actually adding-to/updating whichever file is a simply matter of
> echo/sed after a few checks; I don't think there's an actual command
> to do it.
> I can send you a template script off-list if you like.

Or just link between two pre-set hosts files?...


This is sounding like a Jason NLUG Howto page... ;-) ;-)



- ╔═══════════════════╦══════════════════════════════════════════╗
- ║   Martin Lomas    ║ OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7 ║
- ║ martin@ ml1 co uk ║ Import from   hkp://subkeys.pgp.net   or ║
- ║ ----------------- ║ http:// ml1 .co .uk/martin_ml1_co_uk.gpg ║
- ╚═══════════════════╩══════════════════════════════════════════╝

More information about the Nottingham mailing list