LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Reverse lookup of local computer's external IP fails (https://www.linuxquestions.org/questions/linux-networking-3/reverse-lookup-of-local-computers-external-ip-fails-311172/)

ichi 04-08-2005 02:32 PM

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?

Technoslave 04-08-2005 02:35 PM

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.

ichi 04-08-2005 03:10 PM

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?

cowanrl 04-08-2005 03:29 PM

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

456.123.123.in-addr.arpa

ichi 04-08-2005 03:36 PM

Nope, still doesn't get an answer.

Thanks though.

Pete M 04-08-2005 05:08 PM

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

ichi 04-08-2005 05:21 PM

:D Thanks lots and lots Pete! That solved it!

I didn't realize the numbers at the beginning of the PTR RR line meant anything...:p

Pete M 04-08-2005 05:37 PM

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


All times are GMT -5. The time now is 10:46 AM.