I'm looking for a lightweight dns server that could resolve any possible domain name to a specific IP address (e.g 192.168.1.1).

. -> 192.168.1.1
com -> 192.168.1.1
org -> 192.168.1.1
google.com -> 192.168.1.1
yahoo.com  -> 192.168.1.1
....
anypossibledomainname.evenifitdoesntexist.blah -> 192.168.1.1

Thanks in advance.

link|improve this question

37% accept rate
Which OS? Linux? – theomega Sep 14 '10 at 12:11
feedback

4 Answers

up vote 4 down vote accepted

If you realy want a DNS-Server, then check out DNSMasq. Using the --address Command-Line-Switch and the # wildcard, this should be very easy:

The domain specification works in the same was as for --server, with the additional facility that /#/ matches any domain. Thus --address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive.

Also check out the --no-hosts commandline switch.

See the Man-Page

link|improve this answer
Great. Just what I've been looking for. Thanks a lot. – facha Sep 14 '10 at 13:22
You also need to make sure that dnsmasq doesn't query upstream servers by editing resolv.conf to wrap back to the local machine nameserver 127.0.0.1 – Iain Sep 14 '10 at 13:53
feedback

You're not looking for a DNS server but for a Captive Portal solution, wich is in fact a proxy.

link|improve this answer
I really really do need a DNS server. The description of a "Captive Portal" is provided so that people could get an idea, why I would need a DNS server with such a weird setup. Sorry for being misleading. – facha Sep 14 '10 at 9:34
I've only seen this with captive portals (proxies). They redirect when you don't have credentials to go to the site you want, it's not a DNS thing as much as a redirect to a EULA-type page where you get a chance to authenticate. I don't think you can do this thinking like a DNS server because the DNS server wouldn't know how to resolve everything on the Internet all at once; it's not what it's for. – Bart Silverstrim Sep 14 '10 at 10:16
Ok, I'd better remove the "captive portal" description from the question. – facha Sep 14 '10 at 10:21
I think you might get non "captive portal" answers if you described why exactly you think you need a DNS server to do this. – dunxd Sep 14 '10 at 11:39
feedback

What you want is not a DNS server, but a proxy server. Something like this: http://www.hottproxy.org

link|improve this answer
proxy servers do not resolve names to IPs, do they? – facha Sep 14 '10 at 9:27
@facha No they don't. But you don't want your customers to resolve names to IPs, you want them to be redirected to a specific Webpage. And DNS servers don't redirect to web server do they? – Benoit Sep 14 '10 at 10:08
Sorry for being misleading, I really really do want customers to resolve names to IPs. This is what I'm looking for: "DNS server that would resolve any domain to 192.168.1.1" – facha Sep 14 '10 at 10:15
feedback

If you have a Cisco router, it can be setup to do this:

ip dns server
ip dns spoofing 192.168.1.1

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.