LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-25-2009, 09:23 AM   #1
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Rep: Reputation: 30
bind not resolves forward lookup


I have configured bind9 in a debian lenny multihomed pc which acts as the squid proxy

Recently i configured bind9 and it is working partially

Sorry that I could'nt post the configuration files now, as I am now in home

I can ping the systems
such as ping linux.tempnet.net, server.tempnet.net, cp.tempnet.net

cp - the multihomed pc (192.168.10.1)
Also #host 192.168.10.1 returns cp.tempnet.net
#host 192.168.10.2 returns linux.tempnet.net
#host 192.168.10.4 returns server.tempnet.net

But
#dig 192.168.10.1 is not returning the correct that I think
it displays some root DNS- I think it should return cp.tempnet.net

dig cp.tempnet.net returns 127.0.0.1

Thanks in advance
 
Old 08-25-2009, 04:39 PM   #2
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Quote:
Originally Posted by sunils1973 View Post
But
#dig 192.168.10.1 is not returning the correct that I think
it displays some root DNS- I think it should return cp.tempnet.net

You need the -x for reverse lookups. Try

dig -x 192.168.10.1
 
Old 08-26-2009, 05:22 AM   #3
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Suncoast View Post
You need the -x for reverse lookups. Try

dig -x 192.168.10.1
Yes it works

Thank u
 
Old 09-04-2009, 03:05 AM   #4
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Original Poster
Rep: Reputation: 30
I am trying to configure Bind9 in a multihomed pc in my home
eth1 dhcp - cable modem
eth0 192.168.0.2

Another windows machine 192.168.0.3

What is the problem with DNS configuration?

***************************************************
named.conf
*************************************************************************
debian:/etc/bind/zones# cat /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

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

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

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

include "/etc/bind/named.conf.local";

**********************************************************************
/etc/bind/named.conf.local
********************************************************************
debian:/etc/bind/zones# cat /etc/bind/named.conf.local
//
// 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 "homenet.net" {
type master;
file "/etc/bind/zones/db.homenet.net";
};
zone "0.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.0.168.192";
};
***************************************************************

Forward lookup -
debian:/etc/bind/zones# cat db.homenet.net
; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL 86400
@ IN SOA sun1.homenet.net.root.homenet.net. (
2009080408 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS sun1.homenet.net.
IN MX 10 sun1.homenet.net.
sun1 IN A 192.168.0.2
sun2 IN A 192.168.0.3

*****************************************************
Reverse lookup
***************************************************
debian:/etc/bind/zones# cat db.0.168.192
; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL 86400
@ IN SOA sun1.homenet.net.root.homenet.net. (
2009080408 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS sun1.homenet.net.
IN MX 10 sun1.homenet.net.
2 IN PTR sun1.homenet.net.
3 IN PTR sun2.homenet.net.

***************************************************************
/etc/hosts file
**************************************************************

debian:/etc/bind/zones# cat /etc/hosts
127.0.0.1 localhost
192.168.0.2 sun1.homenet.net sun1
debian:/etc/bind/zones#
**************************************************
 
Old 09-04-2009, 06:09 PM   #5
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Code:
@ IN SOA sun1.homenet.net.root.homenet.net. (

Should be 

@ IN SOA sun1.homenet.net.    root.homenet.net. (

Last edited by Suncoast; 09-04-2009 at 06:10 PM.
 
Old 09-05-2009, 09:19 AM   #6
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Original Poster
Rep: Reputation: 30
Still problem (Actually it was there spaces after the dot. I forget to include space after experiment)

Changed entry
*********************************************************
@ IN SOA sun1.homenet.net. root.homenet.net. (

@ IN SOA sun1.homenet.net. root.homenet.net. (
2009080501 ; Serial

******************************************************
debian:/etc/bind/zones# dig -x 192.168.0.2

; <<>> DiG 9.5.1-P3 <<>> -x 192.168.0.2
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 36045
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

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

;; AUTHORITY SECTION:
168.192.in-addr.arpa. 1672 IN SOA localhost. root. 1 604800 86400 2419200 604800

;; Query time: 32 msec
;; SERVER: 202.88.238.3#53(202.88.238.3)
;; WHEN: Sun Sep 6 06:46:11 2009
;; MSG SIZE rcvd: 91

**************************************************************************
debian:/etc/bind/zones# host 192.168.0.2
Host 2.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)
 
Old 09-05-2009, 09:28 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Add the ORIGIN record after the $TTL line in db.0.168.192 :
Code:
$ORIGIN 0.168.192.in-addr.arpa.
Increase serial and restart bind
 
Old 09-07-2009, 07:55 AM   #8
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Original Poster
Rep: Reputation: 30
host 192.168.0.2
Host 2.0.168.192.in-addr.arpa. not found: 3(NXDOMAIN)

*************************************************************
entry in db.0.168.192

$TTL 86400
$ORIGIN 0.168.192.in-addr.arpa.
 
Old 09-07-2009, 08:06 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Have you increased the serial and restart bind?
What is the output of:
Code:
dig SOA 0.168.192.in-addr.arpa.

Last edited by bathory; 09-07-2009 at 08:09 AM.
 
Old 09-08-2009, 08:04 AM   #10
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Code:
debian:/etc/bind/zones# cat db.0.168.192 
$TTL    86400
@       IN      SOA     sun1.homenet.net.  root.homenet.net. (
                     2009080408         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400         ; Negative Cache TTL
)
                IN      NS      sun1.homenet.net.
2               IN      PTR     sun1.homenet.net.
3               IN      PTR     sun2.homenet.net.
Much of Bind is careful attention to detail. You have some extra data in your reverse file. Try this.

Last edited by Suncoast; 09-08-2009 at 08:10 AM. Reason: add code format
 
Old 09-08-2009, 10:09 AM   #11
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 340

Original Poster
Rep: Reputation: 30
Yes I have changed the serial no also

(For all files like db.0, db.127 db.local etc.. is it necessary to change all serial nos?)
Another problem
When I tried to edit the entries via sed, it corrupted
So I removed the package and also removed the /etc/bind directory.

After the new installation, there was no configuration files. How to obtain the configuration files

Though I have taken backup of the above files, I want the fresh configuration files

How to obtain it?
 
Old 09-08-2009, 12:56 PM   #12
Suncoast
Member
 
Registered: Apr 2009
Location: Largo, Florida
Distribution: Slackware
Posts: 208

Rep: Reputation: 35
Every time you change a Bind file, change the serial number. Just the file you are changing, not all of them.

The widely used format is Year-Month-Day-0_to_99. YYYYMMDD##

This number can be anything you want it to be, as long as the new number is greater than the previous number. This is one of those things that you just need to know to change on your own when requesting help with Bind.

If there is a program to create new Bind files, I don't know what it is. I believe the default sample files are installed with the package.
 
  


Reply



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
forward lookup not working BIND soroccoheaven Linux - Server 6 08-25-2007 04:12 PM
bind forward lookup problems blanny Linux - Networking 2 08-14-2006 04:50 PM
Bind and reverse lookup, something ain't right. Sizam Linux - Networking 1 04-25-2005 06:51 PM
bind reverse lookup thesnaggle Linux - Software 1 03-11-2004 06:19 PM
Bind reverse lookup Kostko Linux - Networking 2 12-07-2002 09:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:42 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
Open Source Consulting | Domain Registration