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

Sorry if this has been asked before, but I can't seem to find any information specific to my case.

I run a server where users can connect with a Nintendo DS game if they change their DS' primary DNS server to my box. I'm currently using a simple python script that basically forwards all requests to their actual addresses except one: gamestats2.gs.nintendowifi.net, which it forwards to my IP. The problem is that this script tends to stop working after a day or two, requiring me to restart it.

Would I be able to override that single host in BIND9 while forwarding all other addresses to their proper IP? Or is there another server that would be better?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

I would use dnsmasq and set the specific override in the config with the

address=/gamestats2.gs.nintendowifi.net/Yo.Ur.Ip.Ad

Directive...

share|improve this answer
    
You are a life-saver! It worked!! All I had to do was install dnsmasq and edit the /etc/dnsmasq.conf file to include the directive. Thank you so much! –  ceolwulf Jan 18 '11 at 19:50

For the record: you can also do this with BIND, but it's a litte more involved. You need to configure bind as the authoritative nameserver for the specific resource record you want to override. For example, if you wanted to redirect gamestats2.gs.nintendowifi.net to your own host, you would need this in your named.conf:

zone "gamestats2.gs.nintendowifi.net" {
        type master;
        file "override.zone";
};

And inside override.zone, a zone definition like this:

$TTL 3600
$ORIGIN gamestats2.gs.nintendowifi.net.

@       IN SOA localhost. lars.localhost. (
        2010011800 ; sn = serial number
        172800     ; ref = refresh = 2d
        900        ; ret = update retry = 15m
        1209600    ; ex = expiry = 2w
        3600       ; min = minimum = 1h
        )

        ; we need one nameserver
        IN NS ns0

        ; and we're overriding the public ip address with
        ; this address.
        IN A 10.0.0.1

ns0     IN A 127.0.0.1

That is, your zone file must provide, minimally, an SOA record, at least one NS record, and there must exist valid A records for the listed nameservers...and you'll probably want a single A record to provide your selected address.

With all this in place:

$ host gamestats2.gs.nintendowifi.net localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases: 

gamestats2.gs.nintendowifi.net has address 10.0.0.1

It's certainly not as convenient as using dnsmasq, but it's worth knowing.

share|improve this answer
    
A couple of months late, but I'd like to say thank you for writing this up. dnsmasq has been great but can't handle a lot of connections so I've been looking into BIND again. –  ceolwulf Apr 9 '11 at 18:39

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.