Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

. ->
com ->
org -> ->  ->
anypossibledomainname.evenifitdoesntexist.blah ->

Thanks in advance.

share|improve this question
Which OS? Linux? – theomega Sep 14 '10 at 12:11
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=/#/ will always return 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

share|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 – Iain Sep 14 '10 at 13:53

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

share|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

What you want is not a DNS server, but a proxy server. Something like this:

share|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" – facha Sep 14 '10 at 10:15

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

ip dns server
ip dns spoofing

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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