LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-08-2005, 02:32 PM   #1
ichi
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 50

Rep: Reputation: 15
Reverse lookup of local computer's external IP fails


I am running a DNS server with Named, which, apart from one thing, works fine.

That one thing is that a reverse lookup of my server's IP fails.

I have purchased a domain (which I shall refer to as mydomain.com), and when I remotely or locally do a 'dig' on it then I get my server's IP address, which is what I want. But then, when I remotely do a 'dig -x' on my server's IP address (which I shall refer to as 123.123.456.123) it doesn't return mydomain.com but the domain my ISP has given to my IP addres.
So I decided to set up the reverse zone DNS information for my IP on my server, and get my domain comany to make it the nameserver for mydomain.com .
When all the reverse zone information was set up, I locally (on the server; locally to the server) can dig mydomain.com and it returns the server's IP address, the same one returned when dug locally. But when I do a reverse dig on 123.123.456.123 it doesn't return an answer section; only this:

Code:
; <<>> DiG 9.2.5 <<>> -x 123.123.456.123
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17325
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

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

;; AUTHORITY SECTION:
123.456.123.123.in-addr.arpa. 86400 IN    SOA     ns1.mydomain.com. hostmaster.mydomain.com. 200504082 28800 7200 2419200 86400

;; Query time: 3 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Apr  8 12:20:56 2005
;; MSG SIZE  rcvd: 109
This is really wierd; I can't see anything wrong with any of my zone files or my 'named.conf' files.

But it's probably something I have no idea about so here are my config files:

named.conf:
Code:
options
{
        directory "/var/named";
        allow-query { any; };
};

zone "."
{
        type hint;
        file "root.hints";
};

zone "0.0.127.in-addr.arpa"
{
        type master;
        file "pz/127.0.0";
};

zone "mydomain.com"
{
        type master;
        notify no;
        file "pz/mydomain.com";
};

zone "123.456.123.123.in-addr.arpa"
{
        type master;
        notify no;
        file "pz/123.456.123.123";
};
mydomain.com:
Code:
$TTL 3D
@       IN      SOA     ns1.mydomain.com. hostmaster.mydomain.com. (
                        200504082       ; serial, todays date + todays serial #
                        8H              ; refresh, seconds
                        2H              ; retry, seconds
                        4W              ; expire, seconds
                        1D )            ; minimum, seconds
;
                NS      ns1.mydomain.com.       ; Inet Address of name server
                MX      10 mydomain.com.  ; Primary Mail Exchanger
;
localhost       A       127.0.0.1
ns1             A       123.123.456.123
mydomain.com. A       123.123.456.123
www             A       123.123.456.123
and 123.456.123.123:
Code:
$TTL 3D
@       IN      SOA     ns1.mydomain.com. hostmaster.mydomain.com. (
                        200504082 ; Serial, todays date + todays serial
                        8H      ; Refresh
                        2H      ; Retry
                        4W      ; Expire
                        1D)     ; Minimum TTL
                NS     ns1.mydomain.com.

1               PTR     ns1.mydomain.com.
2               PTR     mydomain.com.
3               PTR     www.mydomain.com.
In case I've done something else wrong in my DNS files, apart from this specific problem, I want enquiries to ns1.mydomain.com, mydomain.com and www.mydomain.com to go to 123.456.123.123. I also want mail to go to that address.

And yes; all the files are set up in the correct directory. Everything works apart from the local reverse lookup of 123.456.123.123. resolv.conf is setup correctly also, as in:
Code:
search mydomain.com
nameserver 127.0.0.1
is all that's in there.

Anyone got any ideas?

Last edited by ichi; 04-09-2005 at 04:55 AM.
 
Old 04-08-2005, 02:35 PM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
Unless the network address you've been given also gives you the ability to do reverse lookups on it, it won't work.

Chances are good your ISP hasn't given you the authority to do this, that's why it won't work.
 
Old 04-08-2005, 03:10 PM   #3
ichi
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 50

Original Poster
Rep: Reputation: 15
I know it won't work remotely, but why not when I do it on the server whos only nameserver is itself, why shouldn't it? As I said, remotely it does get an answer, the one my ISP gives me, but locally it doesn't get an answer at all. If it wouldn't work because of my ISP not letting me then wouldn't it just return the same thing that it returned remotely?
 
Old 04-08-2005, 03:29 PM   #4
cowanrl
Member
 
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150

Rep: Reputation: 15
Try using only the first 3 octets of your IP address in the zone name, such as:

456.123.123.in-addr.arpa
 
Old 04-08-2005, 03:36 PM   #5
ichi
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 50

Original Poster
Rep: Reputation: 15
Nope, still doesn't get an answer.

Thanks though.
 
Old 04-08-2005, 05:08 PM   #6
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
ichi


Based on IP 123.123.456.456

Code:
$TTL 3D
@       IN      SOA     ns1.mydomain.com. hostmaster.mydomain.com. (
                        200504082 ; Serial, todays date + todays serial
                        8H      ; Refresh
                        2H      ; Retry
                        4W      ; Expire
                        1D)     ; Minimum TTL
                NS     ns1.mydomain.com.


195               PTR     mydomain.com.
ns1 should resolve


Pete

Last edited by Pete M; 04-08-2005 at 05:32 PM.
 
Old 04-08-2005, 05:21 PM   #7
ichi
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 50

Original Poster
Rep: Reputation: 15
Thumbs up

Thanks lots and lots Pete! That solved it!

I didn't realize the numbers at the beginning of the PTR RR line meant anything...
 
Old 04-08-2005, 05:37 PM   #8
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
ichi

I suspect that may be a genuine IP so I have edited my post if I'm correct I suggest you do the same

No problem with the help, pleased you got it working, DNS is sometimes a Bind ?

Pete
 
  


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
Bind and reverse lookup, something ain't right. Sizam Linux - Networking 1 04-25-2005 06:51 PM
reverse lookup question greyhammer Linux - Networking 1 01-26-2005 03:50 PM
Reverse lookup on Postfix Phaethar Linux - Software 1 05-03-2004 04:00 PM
Bind reverse lookup Kostko Linux - Networking 2 12-07-2002 09:06 AM
reverse DNS lookup phil1076 Linux - General 1 01-22-2002 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:52 PM.

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