Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Which OS? Linux? –  theomega Sep 14 '10 at 12:11
add comment

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

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

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
add comment

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

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

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

ip dns server
ip dns spoofing 192.168.1.1

share|improve this answer
add comment

Your Answer

 
discard

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.