[Dnsmasq-discuss] dnsmasq.conf and URL forwarding - CORRECTION
matthias.andree at gmx.de
Wed Jun 22 13:44:43 BST 2011
Am 22.06.2011 14:29, schrieb Brian Talbot:
> Sorry...the previous message was incorrect. I meant to write:
> Using /etc/dnsmasq.conf with address=/#/192.168.1.1 forwards all URLs to
> 192.168.1.1. I am wondering if it is possible to be more specific.
> For example: address=/#aaa/192.168.1.1/aaa.html would forward all URLs
> with "aaa" to 192.168.1.1/aaa.html. I have experimented but cannot seem
> to get this kind of idea to work.
> Is this possible? If so, what is the command? Many thanks.
No you can't.
You are confusing concepts. dnsmasq.conf does not forward URLs, and
works at a lower level. When browsers come into play, dnsmasq only ever
sees the host name. The rest of the URL or URI is a matter between
browser and web server at a much later stage, and dnsmasq isn't ever
aware of it.
Instead, if the forwarded query gets replied to with "no such domain",
only then will dnsmasq resolve to 192.168.1.1.
Note you need server directives if using address=/#/anything - check the
If you want specific URL rewriting, you need to set up and configure a
web server to do that, and to transparently proxy the remaining
requests, which may require network-level traffic redirections through
PF or netfilter.
This is a complex matter and requires a level of network expertise for
several components that you don't appear to have, hence the "no".
More information about the Dnsmasq-discuss