PDA

View Full Version : BIND9 errors


kkonline
11th January 2009, 09:46
Hi,
Below are my zone files and i receive the errors as specified.
mysite.org.db
BIND data file for mysite.org
;
$TTL 604800
@ IN SOA mysite.org. (
2007011501 ; Serial
7200 ; Refresh
120 ; Retry
2419200 ; Expire
604800) ; Default TTL
;
@ IN NS ns1.ns.com.
@ IN NS ns2.ns.com.
mysite.org. IN MX 10 mail.mysite.org.
mysite.org. IN A 200.19.227.135
www IN CNAME mysite.org.
mail IN A 200.19.227.135
ftp IN CNAME mysite.org.
mysite.org. IN TXT "v=spf1 ip4:200.19.227.135 a mx ~all"
mail IN TXT "v=spf1 a -all"
mysite:/etc/bind/zones/master#

;
;dns_rdata_fromtext: mysite.org.db:10: near eol: unexpected end of input
zone mysite.org/IN: loading master file mysite.org.db: unexpected end of input


200.19.227.rev

mysite:/etc/bind/zones/master# more 200.19.227.rev
$TTL 1d ;
$ORIGIN 227.19.200.IN-ADDR.ARPA.
@ IN SOA ns1.ns.com. (
2007011501
7200
120
2419200
604800
)
IN NS ns1.ns.com.
IN NS ns2.ns.com.
1 IN PTR ns1.ns.com.
2 IN PTR ns2.ns.com.
mysite:/etc/bind/zones/master#


mysite:/etc/bind/zones/master# named-checkzone mysite.org 200.19.227.rev
200.19.227.rev:3: ignoring out-of-zone data (227.19.200.IN-ADDR.ARPA)
dns_rdata_fromtext: 200.19.227.rev:8: near eol: unexpected end of input
200.19.227.rev:12: ignoring out-of-zone data (1.227.19.200.IN-ADDR.ARPA)
200.19.227.rev:13: ignoring out-of-zone data (2.227.19.200.IN-ADDR.ARPA)
zone mysite.org/IN: loading master file 200.19.227.rev: unexpected end of input


How to correct these errors?

lqman
11th January 2009, 15:08
Your db file, contain wrong configuration, i will try to FIX it
mysite.org.db
;BIND data file for mysite.org :
;
$TTL 604800
@ IN SOA ns1.mysite.org. yourmailaddress.mysite.org. (
2007011501 ; Serial
7200 ; Refresh
120 ; Retry
2419200 ; Expire
604800) ; Default TTL
;
@ IN NS ns1.ns.com.
@ IN NS ns2.ns.com.
@ IN MX 10 mail.mysite.org.
@ IN A 200.19.227.135

mail IN A 200.19.227.135
www IN CNAME mysite.org.
ftp IN CNAME mysite.org.
mysite.org. IN TXT "v=spf1 ip4:200.19.227.135 a mx ~all"

pay attention to the log file :
;dns_rdata_fromtext: mysite.org.db:10: near eol: unexpected end of input
10 (numeric) means your error on line 10

Regards, LQman.
http://lqman.wordpress.com

falko
12th January 2009, 14:19
Remove the ; sign in line 10.

lqman
13th January 2009, 07:31
@ Falko
In my opinion.
The ; sign isn't counted, ; sign is only for comment.
I found the error, and i have fixed it and rewrite configuration with bold font.

@kkonline
ns1.mysite.org. -> information about authoritative nameserver in your domain / zone.
yourmailaddress.mysite.org. -> mail address domain administrator with special syntax (replace @ sign with . sign).
eg :
yourmailaddress@mysite.org = yourmailaddress.mysite.org
lqman@ee.its.ac.id = lqman.ee.its.ac.id

miki86
23rd November 2010, 23:20
Hello
Can anyone help me with this im stuck and i don't know where my error is.
My reverse dns is not setup like it shuold be, i know this step is optional but i want to learn.

/etc/named.conf
zone "Z.Y.X.in-addr.arpa" {
type master;
file "/var/named/Z.Y.X.in-addr.arpa.rev";
//allow-update { key “rndckey”; };
};

Z.Y.X.in-addr.arpa.rev
Z.Y.X.in-addr.arpa. IN SOA ns1.example.com. webmaster.example.com (
100 ; serial
30M ; refresh
3600 ; retry
3W ; expiry
38400 ) ; minimum

@ IN NS ns1.example.com.
@ IN NS ns2.example.com.

1.0.0.127.in-addr.arpa. IN PTR binggo.example.com.

This is the error im geting when trying to restart bind
Error in named configuration:
zone example.com/IN: loaded serial 100
dns_rdata_fromtext: /var/named/Z.Y.X.in-addr.arpa.rev:1: unexpected end of input
zone Z.Y.X.in-addr.arpa/IN: loading master file /var/named/Z.Y.X.in-addr.arpa.rev: unexpected end of input
_default/Z.Y.X.in-addr.arpa/IN: unexpected end of input

Of course Z.Y.X is my reversed ip address.

lqman
24th November 2010, 05:50
maybe you can try this one.

$TTL 604800
$ORIGIN Z.Y.X.in-addr.arpa.
@ IN SOA ns1.example.com. webmaster.example.com. (
100 ; serial
30M ; refresh
3600 ; retry
3W ; expiry
38400 ) ; minimum

@ IN NS ns1.example.com.
@ IN NS ns2.example.com.

1 IN PTR binggo.example.com.
2 IN PTR bingoagain.example.com.

take a look at the bold characters.

I assume that Z.Y.X.in-addr.arpa = 0.0.127.in-addr.arpa
then, querying your dns server :
nslookup 127.0.0.1 ns1.example.com
nslookup 127.0.0.2 ns1.example.com
or
nslookup 127.0.0.1 ns2.example.com
nslookup 127.0.0.2 ns2.example.com


for easier troubleshoot procces, you must pay attention to /var/log/syslog especially when restarting the named daemon / service
tail -f /var/log/syslog
if you have ccze installed, you get colorize output with
tail -f /var/log/syslog | ccze

I hope this can solve your error.

miki86
24th November 2010, 12:01
Thank you for replaying.

I tried changing my reverse zone file as you sugested and im still geting same error.

sysolg, same error as i posted above:
...in-addr.arpa.zone:1: unexpected end of input...

1 is for line one right?
I can't determine which line one is wrong, my named.conf or zone file :confused:
When i comment out zone calling in my named.conf file everything goes smoothly.

By the way i noticed some errors in log file, i dont know if they are related to bind:
Nov 24 11:54:14 server avahi-daemon[7428]: avahi-daemon 0.6.16 starting up.
Nov 24 11:54:14 server avahi-daemon[7428]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Nov 24 11:54:14 server avahi-daemon[7428]: dbus_bus_get(): Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Nov 24 11:54:14 server avahi-daemon[7428]: WARNING: Failed to contact D-Bus daemon.

falko
24th November 2010, 17:14
1 is for line one right?Yes.

I can't determine which line one is wrong, my named.conf or zone file :confused:
It's line 1 of the zone file.

miki86
24th November 2010, 18:50
Yes but what's wrong with it?
Z.Y.X.in-addr.arpa. IN SOA ns1.example.com. webmaster.example.com (

Looks like the link permissions are not right, since i installed bind-chroot i cant change permission on that link, chown passed but again link owner group is root :confused:

Any ideas?

falko
25th November 2010, 14:14
Make your zonefile look as suggested in post #6.

lqman
26th November 2010, 05:17
miki, please read your config carefully...

I try this in my server & works.

/etc/bind/named.conf.local
zone "example.com" {
type master;
file "/etc/bind/forward";
};

zone "0.0.127.in-addr.arpa" {
type master;
file "/etc/bind/reverse";
};

/etc/bind/forward
$TTL 604800
$ORIGIN example.com.
@ IN SOA ns1.example.com. webmaster.example.com. (
100 ; serial
30M ; refresh
3600 ; retry
3W ; expiry
38400 ) ; minimum

@ IN NS ns1.example.com.
@ IN NS ns2.example.com.

ns1 IN A 127.0.0.1
ns2 IN A 127.0.0.2

bingo IN A 127.0.0.1
bingoagain IN A 127.0.0.2

/etc/bind/reverse
$TTL 604800
$ORIGIN 0.0.127.in-addr.arpa.
@ IN SOA ns1.example.com. webmaster.example.com. (
100 ; serial
30M ; refresh
3600 ; retry
3W ; expiry
38400 ) ; minimum

@ IN NS ns1.example.com.
@ IN NS ns2.example.com.

1 IN PTR bingo.example.com.
2 IN PTR bingoagain.example.com.


this is snippet of my /var/log/syslog when restarting bind service.
Nov 26 09:52:48 gw-blueoffice named[5933]: found 1 CPU, using 1 worker thread
Nov 26 09:52:48 gw-blueoffice named[5933]: using up to 4096 sockets
Nov 26 09:52:49 gw-blueoffice named[5933]: loading configuration from '/etc/bind/named.conf'
Nov 26 09:52:49 gw-blueoffice named[5933]: using default UDP/IPv4 port range: [1024, 65535]
Nov 26 09:52:49 gw-blueoffice named[5933]: using default UDP/IPv6 port range: [1024, 65535]
Nov 26 09:52:49 gw-blueoffice named[5933]: no IPv6 interfaces found
Nov 26 09:52:49 gw-blueoffice named[5933]: listening on IPv4 interface lo, 127.0.0.1#53
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 254.169.IN-ADDR.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 2.0.192.IN-ADDR.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0.0.0.
0.0.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0.0.0.
0.0.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: D.F.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 8.E.F.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: 9.E.F.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: A.E.F.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: automatic empty zone: B.E.F.IP6.ARPA
Nov 26 09:52:49 gw-blueoffice named[5933]: command channel listening on 127.0.0.1#953
Nov 26 09:52:49 gw-blueoffice named[5933]: zone 0.in-addr.arpa/IN: loaded serial 1
Nov 26 09:52:49 gw-blueoffice named[5933]: zone 127.in-addr.arpa/IN: loaded serial 1
Nov 26 09:52:49 gw-blueoffice named[5933]: zone 0.0.127.in-addr.arpa/IN: loaded serial 100
Nov 26 09:52:49 gw-blueoffice named[5933]: zone 255.in-addr.arpa/IN: loaded serial 1
Nov 26 09:52:49 gw-blueoffice named[5933]: zone example.com/IN: loaded serial 100
Nov 26 09:52:49 gw-blueoffice named[5933]: zone localhost/IN: loaded serial 2
Nov 26 09:52:49 gw-blueoffice named[5933]: running
Nov 26 09:52:49 gw-blueoffice named[5933]: zone example.com/IN: sending notifies (serial 100)
Nov 26 09:52:49 gw-blueoffice named[5933]: zone 0.0.127.in-addr.arpa/IN: sending notifies (serial 100)

test resolving address forward & reverse
lqman@gw-blueoffice:~$ host ns1.example.com
ns1.example.com has address 127.0.0.1
lqman@gw-blueoffice:~$ host ns2.example.com
ns2.example.com has address 127.0.0.2
lqman@gw-blueoffice:~$ host bingo.example.com
bingo.example.com has address 127.0.0.1
lqman@gw-blueoffice:~$ host bingoagain.example.com
bingoagain.example.com has address 127.0.0.2
lqman@gw-blueoffice:~$ host 127.0.0.1
1.0.0.127.in-addr.arpa domain name pointer bingo.example.com.
lqman@gw-blueoffice:~$ host 127.0.0.2
2.0.0.127.in-addr.arpa domain name pointer bingoagain.example.com.

come on dude, be-carefully and be-patient with your configuration code.
:)

miki86
26th November 2010, 11:39
I already tried to configure my reverse zone file like yours and that didn't work.

Like there is an error on $TTL 604800 :confused:
Zone file is ok, i think, problem is somewhere else and im gonna leave it for now until i fugure it out.

Thanks appreciate your help.

rudini
7th November 2011, 06:18
Hi, i was installed bind9 in my server, but it didn't work.
This is output below
root@server1:/etc/bind/zones# dig pilihanmobil.net

; <<>> DiG 9.7.3 <<>> pilihanmobil.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 47375
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;pilihanmobil.net. IN A

;; AUTHORITY SECTION:
net. 900 IN SOA a.gtld-servers.net. nstld.verisign-grs.com. 1320638931 1800 900 604800 86400

;; Query time: 328 msec
;; SERVER: 202.134.0.155#53(202.134.0.155)
;; WHEN: Sun Nov 6 23:09:14 2011
;; MSG SIZE rcvd: 107

content of pilihanmobil.net.db is:
// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com. IN SOA ns1.example.com. admin.example.com. (
// Do not modify the following lines!
2007031001
28800
3600
604800
38400
)

// Replace the following line as necessary:
// ns1 = DNS Server name
// mail = mail server name
// example.com = domain name
pilihanmobil.net. IN NS ns1.pilihanmobil.net.
pilihanmobil.net. IN MX 10 mail.pilihanmobil.net.

// Replace the IP address with the right IP addresses.
www IN A 10.0.0.* // * is my server id
mta IN A 10.0.0.*
ns1 IN A 10.0.0.*

Content of reverse is:
//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it.s 1, as my IP address is 192.168.0.1.
@ IN SOA server1.pilihanmobil.net. admin.pilihanmobil.net. (
2007031001;
28800;
604800;
604800;
86400
)

IN NS server1.pilihanmobil.net.
1 IN PTR pilihanmobil.net

Content of named.conf is :

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";


zone "pilihanmobil.net" {
type master;
file "/etc/bind/zones/db.pilihanmobil.net";
};

zone "0.0.0.10.in-addr.arpa" {
type master;
file "/etc/bind/rev.0.0.0.10.in-addr.arpa";
};

Please help me, why it didn't work ?

lqman
7th November 2011, 07:51
what is your log file says?

watch your log file while restarting bind9.

tail -f /var/log/syslog

falko
8th November 2011, 17:11
Does
dig @localhost pilihanmobil.net
work?

Did you check your zone on www.intodns.com?