LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   need help with linux Reverse dns on bind package (https://www.linuxquestions.org/questions/linux-server-73/need-help-with-linux-reverse-dns-on-bind-package-4175628976/)

dr.x 05-03-2018 04:24 PM

need help with linux Reverse dns on bind package
 
Hello Guys .

i have provider who gave me an ip address to my server --> 179.61.178.96
so in their panel i can set the Rdns record .

but indeed i want to have own NS server and to be responsible for putty the RDNS myself .
so the provider made a rule to fwd records to my server .
but i wasn't able to have it working .

here are configs :

[root@li654-134 ~]# cat /etc/named.conf

zone "facebook.com" {
type forward;
forwarders {8.8.8.8;};
};

options {
listen-on port 53 { 127.0.0.1; 198.58.120.134; };
///////////listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; any; };
allow-query-cache { localhost; any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;

forwarders { 8.8.8.8; 8.8.8.8; };
//////forwarders { 8.8.8.8; 8.8.4.4; };

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

///zone "nsdns.ps" IN {
/// type master;
//// file "/var/named/nsdns.ps.zone";
////};

zone "96.178.61.179.in-addr.arpa" IN {
type master;
file "/var/named/96.178.61.179.in-addr.arpa";
allow-update { any; };
};
///179.61.178.96
///96.178.61.179


include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@li654-134 ~]# cat /var/named/
96.178.61.179.in-addr.arpa dynamic/ named.empty named.loopback
data/ named.ca named.localhost slaves/
[root@li654-134 ~]# cat /var/named/96.178.61.179.in-addr.arpa
@ IN SOA ns1.nsdns.ps. root.nsdns.ps. (
2007040301 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)

96.178.61.179.in-addr.arpa. IN NS ns1.nsdns.ps.

2 IN PTR theyacsngoandproject.com.
3 IN PTR 5ab3c14.theyacsngoandproject.com.
[root@li654-134 ~]#


when i check reverse dns of the ip 179.61.178.96 on site --> https://mxtoolbox.com/reverselookup.aspx

i have no Rdns .

any wrong my config above ?

say i want to setup the Rdns to be as --> s1.google.com

whats needed to change on config above ?
is there any mistakes i have above ?


the provider said ::

(((We have only created the following record in the zone 178.61.179.in-addr.arpa

Name: 96.178.61.179.in-addr.arpa
Type: NS
Content: 198.58.120.134
TTL: 3600

This zone 178.61.179.in-addr.arpa is created in our DNS servers below
NS9.HOST1PLUS.COM
NS10.HOST1PLUS.COM
NS8.HOST1PLUS.COM

As a result we are forwarding DNS queries from our DNS servers above to your provided server 198.58.120.134 as per the following trace output:

; DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.5 NS +trace 96.178.61.179.in-addr.arpa
;; global options: +cmd
. 79377 IN NS m.root-servers.net.
. 79377 IN NS j.root-servers.net.
. 79377 IN NS a.root-servers.net.
. 79377 IN NS e.root-servers.net.
. 79377 IN NS l.root-servers.net.
. 79377 IN NS k.root-servers.net.
. 79377 IN NS d.root-servers.net.
. 79377 IN NS b.root-servers.net.
. 79377 IN NS i.root-servers.net.
. 79377 IN NS f.root-servers.net.
. 79377 IN NS h.root-servers.net.
. 79377 IN NS g.root-servers.net.
. 79377 IN NS c.root-servers.net.
;; Received 228 bytes from 181.41.222.18#53(181.41.222.18) in 55 ms

in-addr.arpa. 172800 IN NS a.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS b.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS c.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS d.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS e.in-addr-servers.arpa.
in-addr.arpa. 172800 IN NS f.in-addr-servers.arpa.
;; Received 420 bytes from 199.7.83.42#53(199.7.83.42) in 480 ms

179.in-addr.arpa. 86400 IN NS a.arpa.dns.br.
179.in-addr.arpa. 86400 IN NS ns.lacnic.net.
179.in-addr.arpa. 86400 IN NS ns2.lacnic.net.
179.in-addr.arpa. 86400 IN NS ns3.afrinic.net.
179.in-addr.arpa. 86400 IN NS sec3.apnic.net.
179.in-addr.arpa. 86400 IN NS lacnic.authdns.ripe.net.
179.in-addr.arpa. 86400 IN NS tinnie.arin.net.
179.in-addr.arpa. 86400 IN NS ns-lacnic.nic.mx.
;; Received 257 bytes from 196.216.169.10#53(196.216.169.10) in 398 ms

178.61.179.in-addr.arpa. 86400 IN NS NS9.HOST1PLUS.COM.
178.61.179.in-addr.arpa. 86400 IN NS NS10.HOST1PLUS.COM.
178.61.179.in-addr.arpa. 86400 IN NS NS8.HOST1PLUS.COM.
;; Received 112 bytes from 2001:500:13::c7d4:35#53(2001:500:13::c7d4:35) in 420 ms

96.178.61.179.in-addr.arpa. 3600 IN NS 198.58.120.134.
;; Received 72 bytes from 179.61.195.24#53(179.61.195.24) in 114 ms

;; connection timed out; no servers could be reached

))))



any word Guys ?


kind regard

bathory 05-04-2018 02:38 AM

Quote:

i have provider who gave me an ip address to my server --> 179.61.178.96
so in their panel i can set the Rdns record .

but indeed i want to have own NS server and to be responsible for putty the RDNS myself .
so the provider made a rule to fwd records to my server .
but i wasn't able to have it working .
Since it's only one (1) IP address it's an overkill to setup a dns server just for that. You should use your ISP's control panel to give it a PTR record.

That said, if he gave you the delegation of that IP, then he must point 96.178.61.179.in-addr.arpa zone to your dns server.
Right now from what you've posted, that is 198.58.120.134, but there is no dns server listening on that IP.
Also in the 96.178.61.179.in-addr.arpa zonefile you have set NS to ns1.nsdns.ps, but this gives:
Code:

dig -x 179.61.178.96 @ns1.nsdns.ps 

; <<>> DiG 9.12.1 <<>> -x 179.61.178.96 @ns1.nsdns.ps
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 27493
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

Maybe ns1.nsdns.ps is misconfigured not authoritative for the 96.178.61.179.in-addr.arpa zone

You should try to resolve the above problems first and then we could go on for the rest...


Regards

dr.x 05-04-2018 03:55 AM

Quote:

Originally Posted by bathory (Post 5850504)
Since it's only one (1) IP address it's an overkill to setup a dns server just for that. You should use your ISP's control panel to give it a PTR record.

That said, if he gave you the delegation of that IP, then he must point 96.178.61.179.in-addr.arpa zone to your dns server.
Right now from what you've posted, that is 198.58.120.134, but there is no dns server listening on that IP.
Also in the 96.178.61.179.in-addr.arpa zonefile you have set NS to ns1.nsdns.ps, but this gives:
Code:

dig -x 179.61.178.96 @ns1.nsdns.ps 

; <<>> DiG 9.12.1 <<>> -x 179.61.178.96 @ns1.nsdns.ps
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 27493
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

Maybe ns1.nsdns.ps is misconfigured not authoritative for the 96.178.61.179.in-addr.arpa zone

You should try to resolve the above problems first and then we could go on for the rest...


Regards


thanks for your kind reply .
about # 1 it was down and i put it up now
there is DNS bro here check :
[root@li654-134 ~]# netstat -aunt | grep 53
tcp 0 0 198.58.120.134:53 0.0.0.0:* LISTEN
udp 0 0 198.58.120.134:53 0.0.0.0:*


yes I'm just doing a test for 1 ip if it works i will do the rest for other ips .

about ns1.nsdns.ps what is that ? i want the reverse dns to be ns1.nsdns.ps when i check the reverse ip of my ip .

is my config above ok ?
may be I'm wrong !


again i want the reverse dns of the to be ns1.nsdns.ps

not sure what config above needed to be modified .

kind regards

bathory 05-04-2018 05:02 AM

Quote:

thanks for your kind reply .
about # 1 it was down and i put it up now
there is DNS bro here check :
[root@li654-134 ~]# netstat -aunt | grep 53
tcp 0 0 198.58.120.134:53 0.0.0.0:* LISTEN
udp 0 0 198.58.120.134:53 0.0.0.0:*
It's not reachable from here, so you need to open port 53 UDP/TCP on your firewall


Quote:

yes I'm just doing a test for 1 ip if it works i will do the rest for other ips
.
In this case your ISP should delegate to your the whole 179.61.178.x/y subnet you own


Quote:

about ns1.nsdns.ps what is that ? i want the reverse dns to be ns1.nsdns.ps when i check the reverse ip of my ip .
That hostname is listed in your zonefile as the NS record for the 96.178.61.179.in-addr.arpa zone. You should use the hostname of your box in that RR (from here your box is resolved as li654-134.members.linode.com).
So you need a zonefile like the following:
Code:

$TTL 86400
@ IN SOA ns1.nsdns.ps. root.nsdns.ps. (
2018050401 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)

96.178.61.179.in-addr.arpa. IN NS li654-134.members.linode.com.
96.178.61.179.in-addr.arpa. IN PTR ns1.nsdns.ps.


dr.x 05-04-2018 05:20 AM

Quote:

Originally Posted by bathory (Post 5850524)
It's not reachable from here, so you need to open port 53 UDP/TCP on your firewall


.
In this case your ISP should delegate to your the whole 179.61.178.x/y subnet you own



That hostname is listed in your zonefile as the NS record for the 96.178.61.179.in-addr.arpa zone. You should use the hostname of your box in that RR (from here your box is resolved as li654-134.members.linode.com).
So you need a zonefile like the following:
Code:

$TTL 86400
@ IN SOA ns1.nsdns.ps. root.nsdns.ps. (
2018050401 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)

96.178.61.179.in-addr.arpa. IN NS li654-134.members.linode.com.
96.178.61.179.in-addr.arpa. IN PTR ns1.nsdns.ps.



thank you , it seems the provider block port 53
i emailed them and waiting their reply .

for now i have last Q
the SOA
whats should i put here ?

ns1.nsdns.ps. root.nsdns.ps. ???

or something else ?


regards

bathory 05-04-2018 05:47 AM

Quote:

for now i have last Q
the SOA
whats should i put here ?

ns1.nsdns.ps. root.nsdns.ps. ???

or something else ?
If the authoritative dns server for the 96.178.61.179.in-addr.arpa zone is ns1.nsdns.ps, there is no need to put something else.
Just remember to increase the serial whenever you do changes in the zone file.

In the meantime, waiting for your ISP, you can take a look at this e-book about dns. You can find more details about the SOA RR for example ;)


Regards

dr.x 05-04-2018 06:11 AM

Guys ,

i had no block on server now :

here is my last config after modifications :

zone "178.61.179.in-addr.arpa" IN {
type master;
file "/var/named/178.61.179.in-addr.arpa";
allow-update { any; };
};
///179.61.178.96
///96.178.61.179


include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@li654-134 ~]# cat /var/named/178.61.179.in-addr.arpa
@ IN SOA ns1.yournameserver.com. root.domain.com. (
2007040301 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)

178.61.179.in-addr.arpa. IN NS ns1.yournameserver.com.
178.61.179.in-addr.arpa. IN NS ns2.yournameserver.com.

2 IN PTR blah1.domain.com.
3 IN PTR blah2.domain.com.
4 IN PTR blah3.domain.com.
5 IN PTR blah4.domain.com.
6 IN PTR blah5.domain.com.
96 IN PTR blah5.domain.com.
[root@li654-134 ~]#



still Rdns not working !

regards

smallpond 05-04-2018 06:38 AM

The name of your zone should be 178.61.179.in-addr.arpa not 96.178.61.179.in-addr.arpa.

dr.x 05-04-2018 06:45 AM

Quote:

Originally Posted by smallpond (Post 5850563)
The name of your zone should be 178.61.179.in-addr.arpa not 96.178.61.179.in-addr.arpa.


already like that :
zone "178.61.179.in-addr.arpa" IN {
type master;
file "/var/named/178.61.179.in-addr.arpa";
allow-update { any; };
};


[root@li654-134 ~]# cat /var/named/178.61.179.in-addr.arpa
@ IN SOA ns1.yournameserver.com. root.domain.com. (
2007040301 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)

178.61.179.in-addr.arpa. IN NS ns1.yournameserver.com.
178.61.179.in-addr.arpa. IN NS ns2.yournameserver.com.

2 IN PTR blah1.domain.com.
3 IN PTR blah2.domain.com.
4 IN PTR blah3.domain.com.
5 IN PTR blah4.domain.com.
6 IN PTR blah5.domain.com.
96 IN PTR blah5.domain.com.
[root@li654-134 ~]#




regards

bathory 05-04-2018 07:09 AM

It works from here if I use your dns:
Code:

dig -x 179.61.178.96 @198.58.120.134

; <<>> DiG 9.12.1 <<>> -x 179.61.178.96 @198.58.120.134
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14306
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;96.178.61.179.in-addr.arpa.        IN        PTR

;; ANSWER SECTION:
96.178.61.179.in-addr.arpa. 10800 IN        PTR        blah5.domain.com.

;; AUTHORITY SECTION:
178.61.179.in-addr.arpa. 10800        IN        NS        ns2.yournameserver.com.
178.61.179.in-addr.arpa. 10800        IN        NS        ns1.yournameserver.com.

;; Query time: 115 msec
;; SERVER: 198.58.120.134#53(198.58.120.134)
;; WHEN: Fri May 04 15:01:28 EEST 2018
;; MSG SIZE  rcvd: 136

Otherwise it gives a SERVFAIL.
Ditch the forwarders clause in named.conf, restart bind and see if it helps.
Another guess is that it's a firewall, dnssec or similar problem.

dr.x 05-04-2018 07:16 AM

Quote:

Originally Posted by bathory (Post 5850580)
It works from here if I use your dns:
Code:

dig -x 179.61.178.96 @198.58.120.134

; <<>> DiG 9.12.1 <<>> -x 179.61.178.96 @198.58.120.134
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14306
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;96.178.61.179.in-addr.arpa.        IN        PTR

;; ANSWER SECTION:
96.178.61.179.in-addr.arpa. 10800 IN        PTR        blah5.domain.com.

;; AUTHORITY SECTION:
178.61.179.in-addr.arpa. 10800        IN        NS        ns2.yournameserver.com.
178.61.179.in-addr.arpa. 10800        IN        NS        ns1.yournameserver.com.

;; Query time: 115 msec
;; SERVER: 198.58.120.134#53(198.58.120.134)
;; WHEN: Fri May 04 15:01:28 EEST 2018
;; MSG SIZE  rcvd: 136

Otherwise it gives a SERVFAIL.
Ditch the forwarders clause in named.conf, restart bind and see if it helps.
Another guess is that it's a firewall, dnssec or similar problem.


Yes but i test from the site :

https://mxtoolbox.com/SuperTool.aspx...&run=toolpage#

may be the site above take time to refresh ?


also i want be setting my sever as DNS server for forward .

i just made it to own my own Rdns records .

thanks

bathory 05-04-2018 07:43 AM

Quote:

Yes but i test from the site :

https://mxtoolbox.com/SuperTool.aspx...&run=toolpage#

may be the site above take time to refresh ?
I told you above that it works only using your dns as resolver, otherwise it gives a SERVFAIL.
Are you sure your ISP gave you the whole 179.61.178.0/24 zone delegation? Usually they delegate you the subnet you've bought.
You should verify it with them.


Quote:

also i want be setting my sever as DNS server for forward .
Why? Your dns can resolve any domain in the world without the need of forwarders, using the hint zone.

dr.x 05-04-2018 08:04 AM

Quote:

Originally Posted by bathory (Post 5850591)
I told you above that it works only using your dns as resolver, otherwise it gives a SERVFAIL.
Are you sure your ISP gave you the whole 179.61.178.0/24 zone delegation? Usually they delegate you the subnet you've bought.
You should verify it with them.


Why? Your dns can resolve any domain in the world without the need of forwarders, using the hint zone.



the provider only gave me the ip 179.61.178.96

if it work then they will give me other ranges .

plz only check the ip 179.61.178.96

thanks

bathory 05-04-2018 08:36 AM

Quote:

Originally Posted by dr.x (Post 5850606)
the provider only gave me the ip 179.61.178.96

if it work then they will give me other ranges .

plz only check the ip 179.61.178.96

thanks

He gave you the IP and according to your OP the delegation of just the 96.178.61.179.in-addr.arpa.
So why are you trying to become authoritative for the whole 178.61.179.in-addr.arpa zone?

Use 96.178.61.179.in-addr.arpa as the zone name in /etc/named.conf and the zonefile I've posted in #4 above and see what you get.

dr.x 05-04-2018 09:01 AM

Quote:

Originally Posted by bathory (Post 5850628)
He gave you the IP and according to your OP the delegation of just the 96.178.61.179.in-addr.arpa.
So why are you trying to become authoritative for the whole 178.61.179.in-addr.arpa zone?

Use 96.178.61.179.in-addr.arpa as the zone name in /etc/named.conf and the zonefile I've posted in #4 above and see what you get.


i did ... same result .
here is named.conf file :


zone "96.178.61.179.in-addr.arpa" IN {
type master;
file "/var/named/96.178.61.179.in-addr.arpa";
allow-update { any; };
};



and hete is the zone file :
[root@li654-134 ~]# cat /var/named/96.178.61.179.in-addr.arpa
@ IN SOA ns1.yournameserver.com. root.domain.com. (
2007040301 ;serial
14400 ;refresh
3600 ;retry
604800 ;expire
10800 ;minimum
)


96.178.61.179.in-addr.arpa. IN NS li654-134.members.linode.com.
96.178.61.179.in-addr.arpa. IN PTR ns1.nsdns.ps.



still no Rdns on the public websites

any way to see bind logs if there is trial form someone to take this Rdns my side ?

egards


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