Running a DNS server on Gentoox

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
Post Reply
User avatar
R0Bzombie
Novice
Posts: 32
Joined: Sat Jul 24, 2004 1:31 pm

Running a DNS server on Gentoox

Post by R0Bzombie » Tue Sep 19, 2006 10:44 pm

Hi, I've been using Gentoox for like 2-3 years now and I was always using Zoneedit.com to point to my ip.

Is there a way to bypass zoneedit and tell my domain registrar to point directly to my server ?

Thank you
My linux only Xbox:
V1.0
CheapMod
160gig hdd
128mb Ram
Image

User avatar
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer » Wed Sep 20, 2006 3:31 pm

Whoever sold your your domain name should have an option for you to input your own name server and register it with internic.

First set up bind or your box and get it running locally. Set up your domain and set yourself as your name server and make sure you can resolve all the addys you want. Then make sure your DNS ports are open in your firewall config, register your name server with your domain provider and wait until it gets propegated around. Might take a few days to get things sent around and for cached dns entries to expire.

Let me know if you need help with bind. I've been running it on my box for years.

User avatar
R0Bzombie
Novice
Posts: 32
Joined: Sat Jul 24, 2004 1:31 pm

Post by R0Bzombie » Wed Sep 20, 2006 8:21 pm

Hi, if I follow THIS step by step, should I end up with what I need ?

Thank you
My linux only Xbox:
V1.0
CheapMod
160gig hdd
128mb Ram
Image

orochi
Gentoox Guru!
Posts: 606
Joined: Sun Oct 24, 2004 8:11 am

Post by orochi » Fri Sep 22, 2006 8:19 am

Ive used zone edit for like 6 years now, I just point my .com to my home IP address and all is gravy

User avatar
R0Bzombie
Novice
Posts: 32
Joined: Sat Jul 24, 2004 1:31 pm

Post by R0Bzombie » Wed Sep 27, 2006 12:23 am

orochi wrote:Ive used zone edit for like 6 years now, I just point my .com to my home IP address and all is gravy
Yes but I have 4 zones so only the ip is not good for me
My linux only Xbox:
V1.0
CheapMod
160gig hdd
128mb Ram
Image

User avatar
clpalmer
Power user
Posts: 288
Joined: Sat Jan 29, 2005 6:38 pm

Post by clpalmer » Wed Sep 27, 2006 5:38 pm

I don't know about step by step on that one. There's a few things on there that are overdone so to speak. For example creating a ton of directories for different customers would be great if you were running a full-size dns server, but for yourself, just put it all in one dir. And making acl's is probably not necessary either.

The gist of it should be
- emerge bind
- edit named.conf
- make some zone files (1 per domain and a reverse one for your internal network if you want it)
- rc-update add named
- /etc/init.d/named start
- nslookup with server as localhost and test it
- find an online dns checking service (dnsreport.com for example) and check your domain for errors you didn't think of.

It's important to make sure you update the serial number in each zone file every time you make any changes or it may not get propegated properly. Some of the zones below may not be required, but like I said, it's years old and it works =)

My named.conf:

Code: Select all

options {
        directory "/var/bind";
        listen-on-v6 { none; };
        pid-file "/var/run/named/named.pid";
        allow-recursion { 192.168.1.0/24;127.0.0.1; };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "pri/localhost.zone";
        allow-update { none; };
        notify no;
};

zone "127.in-addr.arpa" IN {
        type master;
        file "pri/127.zone";
        allow-update { none; };
        notify no;
};

zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "pri/192.168.1.zone";
        allow-update { none; };
};

zone "mydomainname.com" {
        type master;
        file "pri/mydomainname.com.zone";
        allow-update { none; };
        allow-transfer {[i]ipofmy2ndnameserver[/i];};
};
127.zone

Code: Select all

$ORIGIN 127.in-addr.arpa.
$TTL 1W
@                       1D IN SOA       localhost. root.localhost. (
                                        2002081601      ; serial
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        localhost.
*                       1D IN PTR       localhost.
192.168.1.zone

Code: Select all

$TTL 1D
@       IN      SOA     ns.mydomainname.com. hostmaster.mydomainname.com. (
                        199802151 ; Serial, todays date + todays serial
                        8H      ; Refresh
                        2H      ; Retry
                        1W      ; Expire
                        1D)     ; Minimum TTL
        IN      NS      ns.mydomainname.com.

1       IN      PTR     server.mydomainname.com.
2       IN      PTR     otherbox.mydomainname.com.
localhost.zone

Code: Select all

$TTL 1W
@       IN      SOA     ns.localhost. root.localhost.  (
                                      2002081601 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      604800     ; Expire - 1 week
                                      86400 )    ; Minimum
                IN      NS      ns
localhost.      IN      A       127.0.0.1
mydomainname.com.zone

Code: Select all

$TTL 3600
@       IN      SOA     ns.mydomainname.com. root.mydomainname.com. (
                                2006092204  ; Serial number YYYYMMDDNN
                                3600        ; Refresh
                                3600        ; Retry
                                1209600     ; Expire
                                3600        ; Min TTL
                                )

                IN      NS      ns.mydomainname.com.
                IN      NS      2ndnameserver.domain.com.

                IN      MX 10   mail.mydomainname.com.

                        HINFO   "XBOX" "Gentoox"

$ORIGIN mydomainname.com.

                IN      A       <server ip>
ns              IN      A       <server ip>
mail            IN      A       <server ip>
www             IN      A       <server ip>

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests