# bind-tutorial



## cruzler (Apr 15, 2009)

Hi all, 

I am sorry if my question is little bit silly, i want to ask about, anyone can give me a link to tutorial about how to install bind9-dns on freebsd? please.. 

i found a few tutorial on google, and i was try to do what it tells to do..but, i become confuse because there is so much different things between one tutorial and another..so i don't know which one is correct.. 


Thanks..


----------



## hydra (Apr 15, 2009)

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-dns.html


----------



## cruzler (Apr 15, 2009)

hydra said:
			
		

> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-dns.html



Thanks sir, i was already know about this one, is there anything more?


----------



## SirDice (Apr 16, 2009)

Installing it is simply a matter of installing the package or port. See the handbook on that.

As for configuring bind itself any linux/*nix tutorial will do. Bind=bind it doesn't matter on what OS it runs on.


----------



## mwatkins (Apr 16, 2009)

I did the following "quick start" up for someone recently. It isn't meant to represent the be-all end-all configuration for bind but perhaps gets you further along the way. 

Assuming you've got bind installed from ports (don't forget to edit /etc/rc.conf):


```
cd /etc/named
mkdir soa
cd soa
cat > db.yourdomain.com <<EOF
```

Then paste the following (edit your domain details carefully first, or after creating the file):


```
; this is a bare minimum stub 
$TTL 3600
@       IN      SOA     ns1.yourdomain.com. hostmaster.yourdomain.com. (
                        2009032401  ; serial number in YYYYMMDD01, 02, 03, etc format. 
                        10800
                        3600
                        604800
                    86400 )         ; min TTL of 1 day
    
; primary name servers
        IN      NS      ns1.yourdomain.com.
        IN      NS      ns2.yourdomain.com.

; mailexchangers
                MX      10 mx1.yourdomain.com.
; ident
                TXT     "Foo Bar Inc. We eat kittens."

;  addresses for canonical names; we'll assume you have minimum two IP's
yourdomain.com.         IN  A       12.34.56.78
eggs.yourdomain.com.    IN  A       12.34.56.78
bacon.yourdomain.com.   IN  A       12.34.56.79

mx1.yourdomain.com.     IN  CNAME   eggs.yourdomain.com.
ns1.yourdomain.com.     IN  CNAME   eggs.yourdomain.com.
ns2.yourdomain.com.     IN  CNAME   bacon.yourdomain.com.

; you could use short form aliases too
mail                    IN  CNAME   yourdomain.com.
ftp                     IN  CNAME   yourdomain.com.
www                     IN  CNAME   yourdomain.com.

EOF
```
That'll leave you with a "zone file" for your domain in the subdirectory `soa`. Now we have to edit named.conf:


```
cd ..
vim named.conf
```

ADD at the very bottom a reference to your newly created zone file:


```
zone "yourdomain.com" in {
    type master;
    file "soa/db.yourdomain.com";
    allow-query { any; };
};
```

Near the top of your named.conf if you don't have an "acl" stanza ADD the following:


```
acl internal {127.0.0.1;};
```

You no doubt will have an "options" block; ensure that at least these lines are in it. Don't remove things you don't know about:


```
options {
    version "surely you must be joking";
    allow-recursion { internal; };

;... more stuff
}
```
If this kick start doesn't get you going, then it's time to hire someone.


----------



## hydra (Apr 16, 2009)

If you know how DNS works, the FreeBSD doc is enough.
Seems you need a bind doc in general, this is a good cookbook: DNS and BIND (5th Edition).
It's the same over all platforms.


----------



## varda (Apr 17, 2009)

Take a look to ZYTRAX web site for some BIND9 documentation. It slightly outdated but has descriptions for most common configuration clauses and has examples too.

http://www.zytrax.com/books/dns/


----------



## johnblue (Apr 17, 2009)

http://www.ask-mrdns.com is always fun!


----------



## cruzler (Apr 18, 2009)

SirDice said:
			
		

> Installing it is simply a matter of installing the package or port. See the handbook on that.
> 
> As for configuring bind itself any linux/*nix tutorial will do. Bind=bind it doesn't matter on what OS it runs on.



Roger that, sir..thanks, for your advise, i am just in panic mode, i meet freebsd since last two weeks ago, and i have deadline for my dns server..puff..make me feel nervous.. -__-" 



			
				mwatkins said:
			
		

> I did the following "quick start" up for someone recently. It isn't meant to represent the be-all end-all configuration for bind but perhaps gets you further along the way.
> 
> Assuming you've got bind installed from ports (don't forget to edit /etc/rc.conf):
> 
> ...



Whoooaa..thanks a lot, sir..hehehe.. 
I would try..  



			
				hydra said:
			
		

> If you know how DNS works, the FreeBSD doc is enough.
> Seems you need a bind doc in general, this is a good cookbook: DNS and BIND (5th Edition).
> It's the same over all platforms.



Yeah, you right, sir.. i just in hurry with my deadline, and in panic mode..so i feel so nervous.. and can't think clearly..  



			
				varda said:
			
		

> Take a look to ZYTRAX web site for some BIND9 documentation. It slightly outdated but has descriptions for most common configuration clauses and has examples too.
> 
> http://www.zytrax.com/books/dns/



Whooo..awesome..!! this is really complete sir..!! Thanks..! 



			
				johnblue said:
			
		

> http://www.ask-mrdns.com is always fun!



Roger that, sir..! I am on my way, thanks to give me your clue.. 

--------------------------------

Now on, this is my problem, on 

```
tail -f /var/log/messages
```
 :


```
Apr 18 16:30:59 bsd1 named[1033]: starting BIND 9.3.5-P2 -t /var/named -u bind
Apr 18 16:30:59 bsd1 named[1033]: none:0: open: /etc/namedb/rndc.key: file not found
Apr 18 16:30:59 bsd1 named[1033]: couldn't add command channel 127.0.0.1#953: file not found
Apr 18 16:30:59 bsd1 named[1033]: none:0: open: /etc/namedb/rndc.key: file not found
Apr 18 16:30:59 bsd1 named[1033]: couldn't add command channel ::1#953: file not found
Apr 18 16:30:59 bsd1 named[1033]: dns_master_load: master/xx.xxx.xxx.in-addr.arpa.rev:2: unexpected end of line
Apr 18 16:30:59 bsd1 named[1033]: dns_master_load: master/xx.xxx.xxx.in-addr.arpa.rev:1: unexpected end of input
Apr 18 16:30:59 bsd1 named[1033]: zone xx.xxx.xxx.in-addr.arpa/IN: loading master file master/xx.xxx.xxx.in-addr.arpa.rev: unexpected end of input
Apr 18 16:30:59 bsd1 named[1033]: dns_master_load: master/mydomain.com.zone:2: unexpected end of line
Apr 18 16:30:59 bsd1 named[1033]: dns_master_load: master/mydomain.com.zone:1: unexpected end of input
Apr 18 16:30:59 bsd1 named[1033]: zone mydomain.com/IN: loading master file master/mydomain.com.zone: unexpected end of input
```

Can anyone give me more clue..hehehe.. 
i think i had wrong in my reverse conf, but i was look it in a few times, and i thought i write it true.. 
Anyway, so sorry to bothering all of u.. 

Thanks..


----------



## cruzler (Apr 20, 2009)

Thanks to all seniors, my problem solved, much of it, because i am not carefully write the file zone..hehe..once again, thanks a lot..


----------

