Override a DNS record using BIND9?

Solution 1:

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

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

Directive...

Solution 2:

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.