LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   www entry in bind9 on debian not working (https://www.linuxquestions.org/questions/linux-newbie-8/www-entry-in-bind9-on-debian-not-working-4175482231/)

Rafael25 10-26-2013 02:13 AM

www entry in bind9 on debian not working
 
Hi,

I am trying to set the bind on my dabian machin.
I can access mydomain.com but i cannot access www.mydaomin.com.

Here is my entire settings:

1) Set the forwarders in /etc/bind/named.conf.options:
Quote:

forwarders {
12.13.14.15;
};
2) Make the domain entry and reverse DNS Entry in /etc/bind/named.conf.local file :
Quote:

zone "mydomain.com" {
type master;
file "/etc/bind/db.mydomain.com";
};

zone "14.13.12.in-addr.arpa" {
type master;
notify no;
file "/etc/bind/db.12";
};
3) Make my domain .db file /etc/bind/db.mydomain.com :
Quote:

$TTL 14400
@ 86400 IN SOA ns1.mydomain.com. root.mydomain.com. (
2013101502 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds

mydomain.com. IN NS ns1.example.com.
mydomain.com. IN NS ns2.example.com.

ns1 IN A 12.13.14.15

ns2 IN A 12.13.14.15


mydomain.com. IN A 12.13.14.15

localhost.mydomain.com. IN A 127.0.0.1

mydomain.com. IN MX 0 mydomain.com.

www IN CNAME mydomain.com.
ftp IN A 12.13.14.15
test IN CNAME mydomain.com.
4) Make the reverse domain file /etc/bind/12.db :
Quote:

;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.mydomain.com root.mydomain.com (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
10 IN PTR mydomain.com.
11 IN PTR www.mydomain.com.
12 IN PTR test.mydomain.com.

5) Here is the changes made in /etc/default/bind9
Quote:

# run resolvconf?
RESOLVCONF=yes

# startup options for the server
OPTIONS="-4 -u bind"


6) Here is my system log after restarting the service:
Quote:


Oct 26 07:09:18 (none) named[5170]: zone 0.in-addr.arpa/IN: loaded serial 1
Oct 26 07:09:18 (none) named[5170]: zone 127.in-addr.arpa/IN: loaded serial 1
Oct 26 07:09:18 (none) named[5170]: zone 255.in-addr.arpa/IN: loaded serial 1
Oct 26 07:09:18 (none) named[5170]: zone 14.13.12.in-addr.arpa/IN: loaded serial 1
Oct 26 07:09:18 (none) named[5170]: zone mydomain.com/IN: loaded serial 2013101502
Oct 26 07:09:18 (none) named[5170]: zone localhost/IN: loaded serial 2
Oct 26 07:09:18 (none) named[5170]: managed-keys-zone ./IN: loaded serial 2
Oct 26 07:09:18 (none) named[5170]: zone mydomain.com/IN: sending notifies (serial 2013101502)
Oct 26 07:09:18 (none) named[5170]: running
Oct 26 07:09:29 (none) named[5170]: success resolving 'ns2.example.com/AAAA' (in 'example.com'?) after reducing the advertised EDNS UDP packet size to 512 octets


Still I cannot access www.mydomain.com.
What am I missing?
Thanks in advance.

bathory 10-26-2013 07:58 AM

Did you increase the serial after adding the www RR?

Rafael25 10-26-2013 08:15 AM

Yes i have increase the PTR
Quote:



@ IN NS ns.
10 IN PTR mydomain.com.
11 IN PTR www.mydomain.com.
12 IN PTR test.mydomain.com.

bathory 10-26-2013 09:38 AM

Quote:

Originally Posted by Rafael25 (Post 5052666)
Yes i have increase the PTR

Not the PTR. The serial number (2013101502).
Change it to 2013102601 and reload bind.

Rafael25 10-28-2013 03:17 AM

I have change the serial number but still not working.
I have to increment serial number every time when i make any changes in that file?
Serial no of domain and reverse entry file should be same?

bathory 10-28-2013 04:08 AM

Quote:

I have to increment serial number every time when i make any changes in that file?
Yes and reload bind

Quote:

Serial no of domain and reverse entry file should be same?
Of course no. You increase the serial in a zonefile when you do changes in that zone. If you don't change something in the reverse zone, you don't have to change its serial.

Quote:

I have change the serial number but still not working.
Did you reload/restart the service?
What gives
Code:

dig www.mydomain.com @12.13.14.15

Rafael25 10-28-2013 04:30 AM

Here is the output of dig www.mydomain.com @12.13.14.15

Quote:


; <<>> DiG 9.8.1-P1 <<>> www.mydomain.com @12.13.14.15
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55722
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;www.mydomain.com. IN A

;; ANSWER SECTION:
www.mydomain.com. 604800 IN A 12.13.14.15

;; AUTHORITY SECTION:
mydomain.com. 604800 IN NS ns.mydomain.com.

;; ADDITIONAL SECTION:
ns.mydomain.com. 604800 IN A 12.13.14.15

;; Query time: 165 msec
;; SERVER: 12.13.14.15#53(12.13.14.15)
;; WHEN: Mon Oct 28 09:28:58 2013
;; MSG SIZE rcvd: 86


bathory 10-28-2013 04:53 AM

Quote:

;; ANSWER SECTION:
www.mydomain.com. 604800 IN A 12.13.14.15
So it works...


All times are GMT -5. The time now is 07:39 AM.