[Nottingham] Two Entries in /etc/hosts

Richard Parsons rp at redwoodlegal.co.uk
Wed Apr 27 09:05:29 UTC 2016

Hello folks

I use my /etc/hosts file in order to point certain hostnames at IP
addresses around the internet. I would like the same hostname to point to a
local IP address when I'm on my home network, and a public IP address when
on any other network. How can I set this up?

I recently discovered that when I was copying things over my local network
it was taking much longer because I was actually using my public IP address
rather than the local one. It seems to make a significant difference to
ping time etc. In fact, pinging myself through the public IP address seems
to be massively less reliable and speedy than using a local IP (maybe that
shouldn't be a surprise). I'm using mtr to test that.

It seems to me to be such a common problem, that there must be solutions
out there just waiting to be used.

If it makes a difference I'm using Arch with netctl to manage my network

Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/nottingham/attachments/20160427/3e425cee/attachment.html>

More information about the Nottingham mailing list