Sure! Redirect all name resolutions to one address with the command:
That is the entry required in the
/etc/dnsmasq.conf file. Which I recommend using as that will enforce such configuration if the server is reboot for any reason.
On the command line, the option is called:
A copy of the dnsmasq manual for
address= is below.
However, even if it may seem reasonable to set
-i vlan (to the expected interface to be used) and
-a 10.6.66.1 (to the address in which it is expected that dnsmasq will listen for DNS resolution). Do not do that!.
Allow dnsmasq to bind in wildcard mode to any and all the server addresses on port 53. That way any request to the server about DNS resolution will be answered by dnsmasq.
The three modes are "wildcard", "bind-interfaces" and "bind-dynamic".
In "wildcard" mode, dnsmasq binds the wildcard IP address (0.0.0.0 or
::). This allows it to receive all the packets sent to the server on
the relevant port. Access control (--interface, --except-interface,
--listen-address, etc) is implemented by dnsmasq: it queries the
kernel to determine the interface on which a packet was received and
the address to which it was sent, and applies the configured
rules. Wildcard mode is the default if neither of the other modes are
Use port 53 (as external clients will expect that by default):
port=53 # It is set to be 53 by default, not really needed.
Turn off (and disallow) both
Make sure that no other program/service is listening on ports 53 or 5353.
$ netstat -pantu | grep ':53'
Also set this options to enforce that names like
mylocaldomain (no dots) are resolved with an error (NXDOMAIN) by the dnsmasq DNS resolver and that (some) name resolutions are not forwarded to any other server:
# Never forward plain names (without a dot or domain part)
# Never forward addresses in the non-routed address spaces.
Ensure that any server set in
/etc/resolv.conf is not used:
All the above will configure the DNS side of dnsmasq to resolve all domains to one simple address. It is still possible to add any other name to resolve other needed addresses by including it in the
/etc/hosts file, like
This last address should be the address to the web-server for the survey.
The initial address above (10.0.0.101) should be the error page that explain what to do to access the survey page.
But that is not all. You also need to configure the DHCP server to supply a nameserver option with the address of the dnsmasq DNS resolver (d not use option number 5, it is obsolete (and should have been for more than 20 years)):
Plus all the other needed configurations for the DHCP part of dnsmasq.
That will allow a computer (tablet or phone also) to get a DHCP given address with a defined DNS server. All protocol compliant computers will follow such configured options and be unable to resolve any other address.
However, it is also possible that a device may try to access directly a IP number (no DNS resolution requested). That must be avoided using IPFilter configuration on the router that serve the local network.
Specify an IP address to return for any host in the given domains. Queries in the domains are never forwarded and always replied to with the specified IP address which may be IPv4 or IPv6. To give both IPv4 and IPv6 addresses for a domain, use repeated -A flags. To include multiple IP addresses for a single query, use --addn- hosts= instead. Note that /etc/hosts and DHCP leases override this for individual names. A common use of this is to redirect the entire doubleclick.net domain to some friendly local web server to avoid banner ads. The domain specification works in the same was as for --server, with the additional facility that /#/ matches any domain. Thus --address=/#/126.96.36.199 will always return 188.8.131.52 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive. As for --server, one or more domains with no address returns a no-such-domain answer, so --address=/example.com/ is equivalent to --server=/example.com/ and returns NXDOMAIN for example.com and all its subdomains.
Add forged DNS entries
Bind configuration to resolve all queries to only one address