LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2010, 03:40 PM   #1
CadeFoster
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Question Bind...


Hello,
I have bind 9.4.3_P3 on slackware 13.0.
Have set the domain dns to ns1.example.com & ns2.example.com they have glue records set, they are also resolved to my linux IP.
Have those bind configuration files.

/etc/named.conf
Code:
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
//        query-source address * port 53;

        /*
         * ISP dns server ip address
         */
//        forward first;
//        forwarders {
//        1.1.1.1;
//       };
//
};

//
// a caching only nameserver config
//
zone "." IN {
        type hint;
        file "caching-example/named.root";
};

zone "localhost" IN {
        type master;
        file "caching-example/localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "caching-example/named.local";
        allow-update { none; };
};

zone "example.com" in {
        allow-transfer { none; };
        file "example.com.zone";
        type master;
};
/var/named/example.com.zone
Code:
$TTL    86400
@       IN      SOA    example.com. root.example.com.  (
                                      2010102602 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
@               IN      NS      ns1.example.com.
@               IN      NS      ns2.example.com.
@               IN      MX      10 mail.example.com.
@               IN      A       8.8.8.8
ns1             IN      A       8.8.8.8
ns2             IN      A       8.8.8.8
smtp            IN      A       8.8.8.8
mail            IN      A       8.8.8.8
www             IN      A       8.8.8.8
ftp             IN      CNAME   ns1.example.com.
irc             IN      CNAME   ns2.example.com.
/etc/resolv.conf
Code:
search example.com
nameserver ns.myisp.com
/etc/hosts
Code:
# For loopbacking.
127.0.0.1               localhost
8.8.8.8                 ns1.example.com ns1
8.8.8.8                 ns2.example.com ns2
# End of hosts.

when I type:

dig example.com
result:
Code:
; <<>> DiG 9.4.3-P3 <<>> example.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22510
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;example.com.             IN      A

;; ANSWER SECTION:
example.com.      86400   IN      A       8.8.8.8

;; AUTHORITY SECTION:
example.com.      86129   IN      NS      ns1.example.com.
example.com.      86129   IN      NS      ns2.example.com.

;; ADDITIONAL SECTION:
ns1.example.com.   86129   IN      A       8.8.8.8

;; Query time: 2 msec
;; SERVER: ns.myisp.com#53(ns.myisp.com)
;; WHEN: Wed Oct 27 22:30:10 2010
;; MSG SIZE  rcvd: 102
dig 8.8.8.8

result:
Code:
; <<>> DiG 9.4.3-P3 <<>> 8.8.8.8
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 64672
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;8.8.8.8.               IN      A

;; AUTHORITY SECTION:
.                       10800   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2010102700 1800 900 604800 86400

;; Query time: 54 msec
;; SERVER: ns.myisp.com#53(ns.myisp.com)
;; WHEN: Wed Oct 27 22:32:38 2010
;; MSG SIZE  rcvd: 108

and my problem is that my domain is not resolving...
Can someone tell me why?
 
Old 10-27-2010, 04:13 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,064
Blog Entries: 14

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
1) dig does not interrogate /etc/hosts. To do that you can try a "ping 8.8.8.8" to see if it finds your host.
Note: for this to find your hosts file you have to have an entry in /etc/nsswitch.conf like:
Code:
hosts:      files dns
That tells it to search your /etc/hosts file first then look in dns.

2) For reverse dig lookups you have to do "dig -x 8.8.8.8".

3) BIND DNS has to have a forward zone like the one you have AND a reverse ARPA zone that has PTR records equating IPs to names.
For example an arpa for "localhost" might be named "arpa.127.0.0" and contain entries like:
Code:
@       IN      SOA     localhost.      root.localhost. (
                                2006012601      ; serial
                                10800           ; refresh
                                3600            ; retry
                                604800          ; expire
                                86400 )         ; default_ttl
;
                NS      localhost.
1               PTR     localhost.
A dig -x 127.0.0.1 would return:

; <<>> DiG 9.3.4-P1 <<>> -x 127.0.0.1
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29466
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;1.0.0.127.in-addr.arpa. IN PTR

;; ANSWER SECTION:
1.0.0.127.in-addr.arpa. 86400 IN PTR localhost.

;; AUTHORITY SECTION:
0.0.127.in-addr.arpa. 86400 IN NS localhost.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Oct 27 16:13:04 2010
;; MSG SIZE rcvd: 77

Last edited by MensaWater; 10-27-2010 at 04:17 PM.
 
Old 10-28-2010, 05:00 AM   #3
CadeFoster
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Unhappy

/etc/nsswitch.conf I have that line:

Code:
hosts:      files dns
also get ping result from my ip.


dig -x 8.8.8.8
get:
Code:
; <<>> DiG 9.4.3-P3 <<>> -x 8.8.8.8
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12310
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;8.8.8.8.in-addr.arpa.  IN      PTR

;; AUTHORITY SECTION:
178.in-addr.arpa.       3600    IN      SOA     ns-pri.ripe.net. dns-help.ripe.n                                                                             et. 2010102834 3600 7200 1209600 7200

;; Query time: 63 msec
;; SERVER: dns.myisp.com#53(dns.myisp.com)
;; WHEN: Thu Oct 28 11:52:57 2010
;; MSG SIZE  rcvd: 106
also have zone file
/var/named/caching-example/named.local
Code:
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.
1             IN      PTR     localhost.
its still the same...
 
Old 10-28-2010, 09:51 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,064
Blog Entries: 14

Rep: Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248Reputation: 1248
The zone file I gave was an EXAMPLE. You need to make one for your 8.8.8 network. My EXAMPLE only shows "localhost" which is a standard entry for all TCP/IP systems. (That is 127.0.0.1 always refers to the host you are on at the time which is typically named "localhost" for that reason.) If you are on server 1 with IP 10.10.10.10 then 127.0.0.1 refers to server 1. If instead you are on sever 2 with IP 10.20.20.20 then 127.0.0.1 refers to server 2.
 
Old 10-28-2010, 03:46 PM   #5
CadeFoster
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
so I must edit your zone example for my ip ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
creating domain name in bind problems exposing bind to internal network abhijit_mohanta Linux - Networking 1 09-03-2009 02:09 AM
creating domain name in bind problems exposing bind to internal network abhijit_mohanta Linux - Security 1 09-03-2009 02:01 AM
Bind problem: config files are missing after re-install bind 9.5 on Fedora Core 8 elvisious Linux - Software 1 07-15-2008 08:49 PM
Can I bind to a serial port using BIND Socket API?? venkat_p257 Linux - General 2 12-04-2007 06:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration