# A FreeBSD box as a DNS server



## m69 (Jul 3, 2012)

Hi all. I want to config FreeBSD as a dns server. I did below configuration bau when I use "nslookup" command it doesn't work. I also enabled named service in rc.conf file. Who can help me? Where is my mistake? Is there any other config that I didn't them?
Thanks
My named.conf file:

```
options {
	directory	"/etc/namedb";
	pid-file	"/var/run/named/pid";
	dump-file	"/var/dump/named_dump.db";
	statistics-file	"/var/stats/named.stats";
};

zone "." { type hint; file "/etc/namedb/named.root"; };

zone "0.0.127.IN-ADDR.ARPA" {
              type master;
              file "master/localhost.rev;
};

zone "ictptk.net" { type master; file "/etc/namedb/master/db.domain"; };

zone "10.10.10.in-addr.arpa" { 
             type master;
             file "/etc/named/master/db.ict";
};

/* An example dynamic zone
key "exampleorgkey" {
	algorithm hmac-md5;
	secret "sf87HJqjkqh8ac87a02lla==";
};
zone "ictptk.net" {
	type master;
	file "master/db.domain";
};
*/

zone "10.10.10.in-addr.arpa" {
	type master;
	file "/master/db.ict";

};

zone "example.org" in {
	type master;
	file "/etc/namedb/master/example.org";
};

zone "10.168.192.in-addr.arpa" {
         type master;
         file "/etc/named/master/10.168.192.in-addr.arpa";
};
```

my db.domain file:

```
$TTL	3600

@	IN	SOA	ns.ictptk.net. root.ns.ictptk.net.   (  
				2001220200       ;Serial
				3600		 ;Refresh
				900		 ;Retry
				3600000		 ;Expire
				3600   )    	 ;Minimum
	                   IN	 NS	ns.ictptk.net.
ictptk.net 	   IN	  A	10.10.10.1 
www.ictptk.net.   IN    CNAME   ictptk.net.
```

my db.ict file:

```
$TTL	3600

@	IN	SOA	ns.ictptk.net. root.ns.ictptk.net.   (  
				2001220200       ;Serial
				3600		 ;Refresh
				900		 ;Retry
				3600000		 ;Expire
				3600   )    	 ;Minimum
	IN	NS	ns.ictptk.net.
1	IN	PTR	ictptk.net.
```


----------



## SirDice (Jul 3, 2012)

And how are we supposed to know what's wrong if you haven't given us any information?


----------



## m69 (Jul 3, 2012)

Sorry I forgot it. I edited it.
Thanks


----------



## SirDice (Jul 3, 2012)

Your ictptk.net zone is defined twice but one is remarked, it's in between /* ..... */.

The 10.10.10.in-addr.arpa zone is defined twice too.

Did you also modify /etc/resolv.conf?


----------



## m69 (Jul 3, 2012)

No I didn't modify /etc/resolv.conf. Can you show a example to me? I think it's better that I restart from first.
Thanks for your help


----------



## SirDice (Jul 3, 2012)

m69 said:
			
		

> No I didn't modify /etc/resolv.conf. Can you show a example to me?


resolv.conf(5)


----------



## TheDreamer (Jul 3, 2012)

NS for your zone is ns.ictptk.net, but there's no A record defined for this.


----------

