# [solved] bind own tld

## mistake25

hi,

what i need to do to setup my own tld, i want to have my own tld (something like .local) for my testing projects, i have just installed bind, configured some basic settings by guide on gentoo-wiki, but there is no guide how to setup own tld. can anyone point me to right way how to setup this?

thanksLast edited by mistake25 on Sun Jul 11, 2010 7:23 pm; edited 1 time in total

----------

## erik258

Hello!  

You'd set up a local, 'fake' tld the same way you'd set up any domain in BIND.  

For example, I have a tld called 'bitfarm' for my wireless network.  I define it thusly:

```
zone "bitfarm" {

        type master; 

        file "pri/bitfarm.fw";

        allow-update { key "rndc-key"; };

};

```

and then the zone record looks something like: 

```
$ORIGIN .

$TTL 7200       ; 2 hours

bitfarm         IN      SOA     ns1.cluster dan.danf.us (

                                2010020701 ; serial

                                7200       ; refresh (2 hours)

                                1800       ; retry (30 minutes)

                                7200       ; expire (2 hours)

                                7200       ; minimum (2 hours)

                                )

                        NS      ns1.cluster

$ORIGIN bitfarm.

pascal                  A       172.17.9.1
```

When I look up, for example, pascal.bitfarm:

```
dan@pascal ~ $ nslookup pascal.bitfarm

Server:         127.0.0.1

Address:        127.0.0.1#53

Name:   pascal.bitfarm

Address: 172.17.9.1
```

As you can see, BIND doesn't care whether 'bitfarm' is a public, 'real' TLD or just something I made up. 

But there is a catch: you need to look up the names on the local nameserver before you look them up online.  There are a number of reasons you might be looking up your names publicly instead.  For starters, you might have a local recursive view and a public nonrecursive view, and not want to replicate public data in the local view, so you'd have to have the local view look up public names publicly instead (the public upstream servers would then refer the nameserver back to itself).  Or, perhaps you have foreward-first or forward-only in your named.conf.  

At any rate, the important thing is that you don't expect a public IP to send you back to your local name server for names in your made-up TLD.  

Well, hope it helps.  Let me know if you have any more problems, I love BIND and would be happy to help. 

-- DF

----------

## mistake25

sorry, but this is my first try with bind, i have no idea about configuration on my own domains/fake tlds....can you more describe these configuration files, i want to bind redirect *.dp to my local server and let apache to do next redirect by adress(i have already apache configured)...

so only thing i want bind to do is if anyone try to open *.dp he will be given 192.168.0.5 IP, or how i describe it and i want to anoyone, that have setup my server as dns server to be able to do this...if it is ununderstable please let me know i try to describe better what i want and sorry for me english.

thanks

----------

