[Dnsmasq-discuss] allowing interface names as parameters to 'alias' option

Simon Kelley simon at thekelleys.org.uk
Wed Nov 28 21:00:46 GMT 2012


On 27/11/12 15:41, Don Muller wrote:
>
>
>
>
> Quick suggestion: how hard would it be to enhance the 'alias' option to
> understand interface names, as well as IP addresses? In other words, be able
> to write something like:
>
> alias = eth0, br0
>
> or
>
> alias = eth0, 192.168.1.10
>
> instead of
>
> alias = 86.30.247.112, 192.168.1.10
>
> This would be particularly useful if it could transparently cope with an
> interface's IP address changing, e.g. a WAN interface with a dynamic IP
> address.
>
> Some background: I run a few services on my server at home (e.g. asterisk)
> where latency matters. The rest is hosted, along with my DNS records.
> Without an 'alias' line like those above, DNS lookups will return the public
> IP address of my router to my LAN clients too, and so they'll send all the
> traffic through the router.


I don't quite understand the setup here: are 86.30.247.112 and 
192.168.1.10 both addresses in the router? or are you using 
port-forwarding from the router to another server?

There is something slighly similar to waht you want already: see the 
--interface-name in the man page. That avoids round-trips to the public 
DNS to get the (dynamic) address of the public interface.

>
> While that's rather inefficient (routing traffic between two nodes on the
> same Gb network through a soho router), it also means that ports I purposely
> don't forward from the public internet also don't get forwarded for LAN
> clients.
>
> Luckily I'm running custom router firmware and have a static IP, so I'm able
> to add that line manually to dnsmasq.conf on the router. But it'd be nice if
> distributions could incorporate something like this as standard, to
> compliment port forwarding/'DMZ server'-type features.
>


A problem is the concept of "The address of an interface" is becoming 
rather muddied. Interfaces frequently have more than one address, and 
especially more than one IPv6 address.


> Just a thought,
>
> - Paul
>
> Maybe I'm understanding this incorrectly but it sounds like you are using
> the same FQDN inside your lan and also outside on the wan/internet. If this
> is the case just add entries to your host file with the local addresses.
> When connected/resolving locally you will get the local address and when
> connected to the internet you will get the address of your router.
>
>
A good, simple solution.



Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list