# BIND problem



## makxx91 (Mar 4, 2013)

Hi, I'm trying to test BIND.
/etc/named.conf:

```
zone "doctor.org" { type master; file "/etc/namedb/dynamic/doctor.org"; };
zone "88.168.192.in-addr.arpa" { type master; file "/etc/namedb/master/88.168.192.in-addr.arpa"; };
```

/etc/namedb/dynamic/doctor.org

```
$TTL 3h
doctor.org. IN SOA doctor.org. doctor.doctor.org. 42 1d 12h 1w 3h
NS doctor.org.
A 192.168.88.4 ;addres where on which is server
AAAA ::1
```

/etc/namedb/master/88.168.192.in-addr.arpa

```
$TTL 3h
@ SOA @ doctor.doctor.lv 42 1d 12h 1w 3h
@ NS @
@ A 192.168.88.4
```

And at startup I get:

```
server named[564]: zone doctor.lv/IN: loading from master file /etc/namedb/dynamic/doctor.lv failed: unknown class/type
server named[564]: zone doctor.lv/IN: not loaded due to errors.
```

I don't get where is the problem.


----------



## makxx91 (Mar 4, 2013)

Ohh sorry,
/etc/namedb/master/88.168.192.in-addr.arpa

```
$TTL 3h
@ SOA @ doctor.doctor.org 42 1d 12h 1w 3h
@ NS @
@ A 192.168.88.4
```


```
server named[564]: zone doctor.org/IN: loading from master file /etc/namedb/dynamic/doctor.org failed: unknown class/type
server named[564]: zone doctor.org/IN: not loaded due to errors.
```


----------



## bkouhi (Mar 4, 2013)

You cannot omit class field in /etc/namedb/dynamic/doctor.org:


```
$TTL 3h
doctor.org. IN SOA doctor.org. doctor.doctor.org. 43 1d 12h 1w 3h
     [B]IN[/B]    NS doctor.org.
     [B]IN[/B]    A 192.168.88.4 ;addres where on which is server
     [B]IN[/B]    AAAA ::1
```

/etc/namedb/master/88.168.192.in-addr.arpa:

```
$TTL 3h
@ [B]IN[/B] SOA [B]doctor.org.[/B] doctor.doctor.org 43 1d 12h 1w 3h
@ [B]IN[/B] NS [B]doctor.org.[/B]
[B]4 IN PTR doctor.org.[/B]
```


----------



## makxx91 (Mar 5, 2013)

But I don't het it, I added everywhere class(IN), but still, I get the same error.


----------



## bkouhi (Mar 5, 2013)

What's the output of this commands?

`% dig @ip.of.dns.server doctor.org`
`% dig @ip.of.dns.server -x 192.168.88.4`

Also please make sure 192.168.88.4  is really exist on your server. After editing that files, you must update serial number and reload your bind.

`# service named reload`


----------



## makxx91 (Mar 5, 2013)

It says for both commands:

192.168.88.4 is the IP of my machine, where I try to configure server.


----------



## makxx91 (Mar 5, 2013)

```
%: Too many arguments.
```


----------



## bkouhi (Mar 5, 2013)

makxx91 said:
			
		

> ```
> %: Too many arguments.
> ```



Remove that % from beginning of commands. That is not part of command.

`dig @192.168.88.4 doctor.org`
`dig @192.168.88.4 -x 192.168.88.4`


----------



## makxx91 (Mar 5, 2013)

*F*or both commands, *I* get the same message:

```
;<<>> DiG 9.6-ESV-R5-P1<<>> @192.168.88.4 doctor.org
;(1 server found)
;; global options: +cmd
;; connection timed out; no server could be reached
```


----------



## bkouhi (Mar 5, 2013)

Huh?
Are you sure named is running? Something is preventing your access to named. (like a firewall)

You can check if named is running by this command:

`sockstat -l | grep named`

If you are using a firewall, check it's ruleset and allow traffic on port 53 (both UDP and TCP)

I have checked that configuration (#3 post) in my system. it works very well. So the problem is not related to named configuration.


----------



## makxx91 (Mar 5, 2013)

In /etc.rc.conf it is enabled, *I* don't know if I am using firewall, *I* just installed FreeBSD, configured NFS and Samba, and BIND gives me this problem.


```
bind named 562 20 tcp4 127.0.0.1:53 *:*
bind named 562 21 tcp4 127.0.0.1:953 *:*
bind named 562 22 tcp6 ::1:953 *:*
bind named 562 512 udp4 127.0.0.1:53 *:*
root syslogd 478 7 dgram /var/named/var/run/log
```


----------



## GenosTechServices (Mar 5, 2013)

I'm new but I thought Unix only supported jfs,gpfs,hfs,ufs,xfs,zfs formats,

If you wanna support NFS you gotta go to Linux. I think?


----------



## makxx91 (Mar 5, 2013)

NFS works perfectly, no problems, I have problem only with BIND. FreeBSD is a 'nix system, Linux also is a 'nix system, therefore no problem with both.


----------



## GenosTechServices (Mar 5, 2013)

Alright I'm never using wikipedia to try and sound smart again.. I'm going to bed.. Good bye. 

http://www.diffen.com/difference/Linux_vs_Unix

Thanks for ur *your* intel.


----------



## bkouhi (Mar 5, 2013)

makxx91 said:
			
		

> In /etc.rc.conf it is enabled, I don't know if I am using firewall, I just installed FreeBSD, configured NFS and Samba, and BIND gives me this problem.
> 
> 
> ```
> ...



I don't see that named is listening on 192.168.88.4.

Add this line in your named.conf (~ line 22):


```
listen-on       { 127.0.0.1; 192.168.88.4; };
```

Then:
`service named stop`
`service named start`

It should work.


----------



## makxx91 (Mar 5, 2013)

Still, gives the same error message.


----------



## bkouhi (Mar 5, 2013)

Please show us your whole named.conf and also the exact error message:

`grep -v '^//' /etc/namedb/named.conf |grep -v '^$'`

You can use named-checkzone(8)() and named-checkconf(8)() to debug your zone files and named.conf respectively:


```
[CMD="%"]cat /etc/namedb/dynamic/doctor.org [/CMD]
$TTL 3h
doctor.org. IN SOA doctor.org. doctor.doctor.org. 44 1d 12h 1w 3h
     IN    NS doctor.org.
     IN    A 192.168.1.5 ;addres where on which is server
     IN    AAAA ::1
[CMD="%"]named-checkzone doctor.org /etc/namedb/dynamic/doctor.org [/CMD]
zone doctor.org/IN: loaded serial 44
OK
[CMD="%"]cat /etc/namedb/master/1.168.192.in-addr.arpa [/CMD]
$TTL 3h
@ IN SOA doctor.org. doctor.doctor.org 43 1d 12h 1w 3h
@ IN NS doctor.org.
5 IN PTR doctor.org.
[CMD="%"]named-checkzone 1.168.192.in-addr.arpa /etc/namedb/master/1.168.192.in-addr.arpa[/CMD]
zone 1.168.192.in-addr.arpa/IN: loaded serial 43
OK
[CMD="%"]tail -2 /etc/namedb/named.conf[/CMD]
zone "doctor.org" { type master; file "/etc/namedb/dynamic/doctor.org"; };
zone "1.168.192.in-addr.arpa" { type master; file "/etc/namedb/master/1.168.192.in-addr.arpa"; };
[CMD="%"]named-checkconf[/CMD]
[CMD="%"]echo $?[/CMD]
0
[CMD="%"]host doctor.org[/CMD]
doctor.org has address 192.168.1.5
doctor.org has IPv6 address ::1
[CMD="%"]host 192.168.1.5[/CMD]
5.1.168.192.in-addr.arpa domain name pointer doctor.org.
```

That files are same as yours, except the IP address.

Also add this line into /etc/resolv.conf:

```
nameserver 127.0.0.1
```


----------



## makxx91 (Mar 5, 2013)

/etc/namedb/named.conf I modified just a little, added ~22 line, and in the end, where is exmaple section added.

```
[CMD="#"]cat /etc/namedb/dynamic/doctor.org[/CMD]
$TTL 3h
doctor.org. IN SOA doctor.org. doctor.doctor.org 42 1d 12h 1w 3h
IN NS doctor.org
IN A 192.168.88.4
AAAA ::1
[CMD="#"]cat /etc/namedb/master/88.168.192.in-addr.arpa[/CMD]
$TTL 3h
@ IN SOA doctor.org. doctor.doctor.org. 42 1d 12h 1w 3h
@ IN NS doctor.org.
4 IN PTR doctor.org.
[CMD="#"]named-checkzone 88.168.192.in-addr.arpa /etc/namedb/master/88.168.192.in-addr.arpa[/CMD]
zone 88.168.192.in-addr.arpa/IN: loaded serial 42
OK
[CMD="#"]named-checkzone doctor.org /etc/namedb/dynamic/doctor.org[/CMD]
/etc/namedb/dynamic/doctor.org:5: unknown RR type '::1"
zone doctor.org/IN: loading from master file /etc/namedb/dynamic/doctor.org failed: unknown class/type
zone doctor.org/IN: not loaded due to errors.
[CMD="#"]tail -2 /etc/namedb/named.conf[/CMD]
zone "doctor.org" { type master; file "/etc/namedb/dynamic/doctor.org"; };
zone "88.168.192.in-addr.arpa" { type master; file "/etc/namedb/master/88.168.192.in-addr.arpa"; };
[CMD="#"]named-checkconf[/CMD]
[CMD="#"]echo $?[/CMD]
0
[CMD="#"]host doctor.org[/CMD]
Host doctor.org not found: 2(SERVFAIL)
[CMD="#"]host 192.168.88.4[/CMD]
4.88.168.192.in-addr.arpa domain name pointer doctor.org
```

/etc/resolv.conf have the line.
Still have the same error.


----------



## bkouhi (Mar 5, 2013)

I see your /etc/namedb/master/88.168.192.in-addr.arpa has some errors:

Make some space before *IN*. Spaces are important.
Place *IN* field in AAAA record.

Copy and paste this lines:


```
$TTL 3h
doctor.org. IN SOA doctor.org. doctor.doctor.org. 44 1d 12h 1w 3h
     IN    NS doctor.org.
     IN    A 192.168.88.4 ;addres where on which is server
     IN    AAAA ::1
```

`service named restart`


----------



## makxx91 (Mar 5, 2013)

Thank you, it works, added *IN* in AAAA line in /etc/namedb/dynamic/doctor.org and now it work*s*.


----------



## bkouhi (Mar 5, 2013)

You're welcome. I'm glad to see it works  Please, no need to thank me


----------

