Is it possible to set a wildcard *
in a path pattern?
address=.example.com/foo/*/bar
does not seem to work.
address=.example.com/foo/xxx/bar
works but I have random characters I need to match for and I don't know what they are ahead of time.
Not possible.
dnsmask is about the resolution of the host name only.
Everything after the slash is between the web browser (or client) and the web server, the name servers don't ever get to see this part.
It can get confusing, because dnsmasq uses '/' as its separator character in a lot of its settings, but this is nothing to do with the path part of a url, simply a chose of config file delimiter.
To achieve some fine grained manipulation of what parts of a web server you want your users to see, you should be googling "http proxies" or possibly "transparent http proxies" and this should get you started. These provide an intermediate server that does get to see the "path" part of the URL, and con do this level of filtering.
来源:https://stackoverflow.com/questions/43012355/wildcard-paths-in-dnsmasq