[Nottingham] Two Entries in /etc/hosts

Jason Irwin jasonirwin73 at gmail.com
Thu Apr 28 12:21:58 UTC 2016


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

J.



More information about the Nottingham mailing list