Posted: Sun Jun 01, 2008 21:11 Post subject: DNSmasq resolution for Captive Portal
I have DNSmasq set up to act as DHCP and DNS servers. DHCP works fine, handing out a static lease to a server on the LAN and handing out IPs to wireless clients.
In the DNSmasq DNS options box, I added the line: address=/#/192.168.0.253 (the address of the web server). OK. All lookups from clients on the LAN resolve to 192.168.0.253. Great. I also have HTTP redirect set to forward all web traffic to the web server.
My question might seem a bit silly. I must be missing something simple. Instead of running an intercept proxy, I've set up DNSmasq to resolve all requests to my server IP. The web server computer has the firewall on it, so I don't need to do any filtering on the router.
So why if I go to a web browser and type in: http://www.dd-wrt.com (or anything, like http://blah.blah) that the browser will go to my web server correctly, but if I try something like: http://www.dd-wrt.com/phpBB2.html the browser will give me an error back? It's ONLY when the browser tries to go to a page on a domain that I have a problem. I get an error back that the site can't be resolved. Clearing the web cache and history does nothing.
I've been playing with getting this work for a few months now. I MUST point out that there is NO internet here, just a LAN where clients connect and are directed to a web server. Either the router or the machine running the web server has to run a name server.
Silly person, of course you're getting an error - unless you have that file (/phpBB2.html) present at that address on YOUR server, you're going to get a 404!
To resolve this, you'll simply have to set up your server to redirect all URI queries to your web servers index page, perhaps with .htaccess rules if you're on Apache or whatever else if you're not.