33

I'm running Ubuntu server on a computer used as a wireless AP, but this AP should resolve all DNS requests to an internal IP address rather than actually performing the lookup.

I want to do the same thing that paid public WiFi hotspots do - you can connect but if you attempt to load any websites they show a default page. I've noticed that they do this by resolving all domains to an internal IP address.

I've added these lines to /etc/dnsmasq.conf:

# Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local
# web-server.
address=/com/192.168.2.1
address=/uk/192.168.2.1
address=/org/192.168.2.1
address=/gov/192.168.2.1
address=/net/192.168.2.1
address=/us/192.168.2.1

which works fine for those TLD's, but I'd like to be able to do it with all domains so I can sleep at night.

Matt
  • 655
  • 1
  • 7
  • 14

2 Answers2

61

As the dnsmasq manual says …

… just use # for a wildcard:

address=/#/192.168.2.1
JdeBP
  • 4,110
1

Beware that although dnsmasq's manual might say anything in its version 2.86

address=/#/…IP.IP.IP.IP…

no longer works — a bug probably.

poige
  • 9,730
  • 3
  • 28
  • 53