<div dir="ltr"><div><div>Thanks Jason. Sorry to sound so dumb, but I can't find anywhere on my router (boring home Virgin media blah) to set a domain name. Maybe I should man up and buy myself something on which I can use DD-WRT too...<br><br></div></div><div>I'm using Arch and it looks like the equivilent of if-up.d is to set a configuration variable in the relevant netcfg profile: <a href="https://www.archlinux.org/netcfg/features.html">https://www.archlinux.org/netcfg/features.html</a>. There's a section called "Execute commands before/after interface up/down" which explains how to do it.<br><br></div><div>That begs the question of how to set a hostname at the commandline? I'd need to be able to run a command to "add" an entry to my /etc/hosts.<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 27, 2016 at 11:53 AM, Jason Irwin <span dir="ltr"><<a href="mailto:jasonirwin73@gmail.com" target="_blank">jasonirwin73@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I use my domain name and let the router worry about it, I am blessed<br>
with a fairly static IP (although there are ways to dial with more<br>
dynamic ones).<br>
Can you fiddle with the router so it recognises WAN as "self"?<br>
I just checked my ping times for local/remote IPs and didn't see much change.<br>
Due to a bug in DD-WRT, I have had to do IP Tables shenanigans so make<br>
things work; so that might mean I don't see the same problem.<br>
<br>
If not, I guess you could have a wee systemd or /etc/network/if-up.d<br>
thing to check if your IP is 192.168.x.y (or whatever other feature of<br>
home LAN is unique), then inject the local IP or remote IP. Seems like<br>
a kludge so me though.<br>
<br>
I am sure someone who actually understands networking wizardry will be<br>
along shortly...<br>
<br>
J.<br>
<div><div class="h5"><br>
On 27 April 2016 at 10:05, Richard Parsons <<a href="mailto:rp@redwoodlegal.co.uk">rp@redwoodlegal.co.uk</a>> wrote:<br>
> Hello folks<br>
><br>
> I use my /etc/hosts file in order to point certain hostnames at IP addresses<br>
> around the internet. I would like the same hostname to point to a local IP<br>
> address when I'm on my home network, and a public IP address when on any<br>
> other network. How can I set this up?<br>
><br>
> I recently discovered that when I was copying things over my local network<br>
> it was taking much longer because I was actually using my public IP address<br>
> rather than the local one. It seems to make a significant difference to ping<br>
> time etc. In fact, pinging myself through the public IP address seems to be<br>
> massively less reliable and speedy than using a local IP (maybe that<br>
> shouldn't be a surprise). I'm using mtr to test that.<br>
><br>
> It seems to me to be such a common problem, that there must be solutions out<br>
> there just waiting to be used.<br>
><br>
> If it makes a difference I'm using Arch with netctl to manage my network<br>
> connections.<br>
><br>
> Many thanks<br>
> Richard<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Nottingham mailing list<br>
> <a href="mailto:Nottingham@mailman.lug.org.uk">Nottingham@mailman.lug.org.uk</a><br>
> <a href="https://mailman.lug.org.uk/mailman/listinfo/nottingham" rel="noreferrer" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/nottingham</a><br>
<br>
_______________________________________________<br>
Nottingham mailing list<br>
<a href="mailto:Nottingham@mailman.lug.org.uk">Nottingham@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/nottingham" rel="noreferrer" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/nottingham</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><font color="#000000">Redwood Legal</font></div><div style="font-size:small"><font color="#000000"><a href="mailto:rp@redwoodlegal.co.uk" target="_blank">rp@redwoodlegal.co.uk</a><br></font></div><div style="font-size:small"><font color="#000000">Office: 02030 956010</font></div><div style="font-size:small"><font color="#000000">138-140 Southwark Street, London, SE1 0SW<br></font></div><div style="font-size:small"><font color="#000000"><br></font></div><div style="font-size:small"><font color="#000000">This firm is authorised and regulated by the Solicitors Regulation Authority (SRA ID 427552)</font><br></div></div></div></div></div></div></div></div></div>
</div>