LinuxQuestions.org
Review your favorite Linux distribution.
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 01-15-2017, 05:12 AM   #1
Shyamal796
LQ Newbie
 
Registered: Nov 2016
Location: Dhaka
Posts: 9

Rep: Reputation: Disabled
How to solve Reverse DNS Resolution (No PTR Record found) problem???


Dear,
I cannot configure Reverse RTR Record correctly in my DNS Server. I also cannot find any problem on zone file using “named-checkzone” command. I configured a DNS Server and Postfix Mail Server in a same machine/host. I am using a Public IP Address and my registered domain. My Server OS version is rhel 7.

For SMTP Reverse DNS Resolution problem, my mail is identified as spam and going to spam folder on gmail/yahoomail. How can I solve these below problem:
1. SMTP Reverse DNS Resolution - No PTR Record found
2. error (network unreachable) resolving…. (showing is in log)
Please help……….

Domain Name: www.example.com
Mail Server IP: 122.X.X.102
DNS and Mail Server Hostname: mail.example.com

# cat /etc/sysconfig/network-scripts/ifcfg-enp2s0
Quote:
IPADDR0=122.X.X.102
PREFIX0=26
GATEWAY0=122.X.X.65
DNS1=122.X.X.102
# cat /etc/resolv.conf
Quote:
search example.com
nameserver 122.X.X.102
# cat /etc/hosts
Quote:
122.X.X.102 mail.example.com mail
This is the named.config file:
# vim /etc/named.conf
Quote:
options {
listen-on port 53 { 127.0.0.1; 122.X.X.102; };
#l isten-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 { any; };

zone "mail.example.com" IN {
type master;
file "fwd-example.zone";
allow-update { none; };
};

zone "X.X.122.in-addr.arpa" IN {
type master;
file "rev-example.zone";
allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
This is the forward zone file:
# vim /var/named/fwd-example.zone
Quote:
$TTL 1D
@ IN SOA mail.example.com. admin.example.com. (
3 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS mail.example.com.
IN A 122.X.X.102
mail IN A 122.X.X.102
IN MX 10 mail.example.com.
This is the reverse zone file:
# vim /var/named/rev-example.zone
Quote:
$TTL 1D
@ IN SOA mail.example.com. admin.example.com. (
3 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS mail.example.com.
IN A 122.X.X.102
102 IN PTR mail.example.com.
LOG:
Quote:
Jan 15 16:48:59 mail systemd: Starting Berkeley Internet Name Domain (DNS)...
Jan 15 16:48:59 mail named-checkconf: zone mail.example.com/IN: loaded serial 0
Jan 15 16:48:59 mail named-checkconf: zone X.X.122.in-addr.arpa/IN: loaded serial 0
Jan 15 16:48:59 mail named[4722]: starting BIND 9.9.4-RedHat-9.9.4-14.el7 -u named
.
.
.
.
Jan 15 16:48:59 mail named[4722]: listening on IPv4 interface lo, 127.0.0.1#53
Jan 15 16:48:59 mail named[4722]: listening on IPv4 interface enp2s0, 122.X.X.102#53
Jan 15 16:48:59 mail named[4722]: generating session key for dynamic DNS
Jan 15 16:48:59 mail named[4722]: sizing zone task pool based on 3 zones
Jan 15 16:48:59 mail named[4722]: using built-in DLV key for view _default
Jan 15 16:48:59 mail named[4722]: set up managed keys zone for view _default, file '/var/named/dynamic/managed-keys.bind'
Jan 15 16:48:59 mail named[4722]: automatic empty zone: 10.IN-ADDR.ARPA
Jan 15 16:48:59 mail named[4722]: automatic empty zone: 16.172.IN-ADDR.ARPA
Jan 15 16:48:59 mail named[4722]: automatic empty zone: 17.172.IN-ADDR.ARPA
Jan 15 16:48:59 mail named[4722]: automatic empty zone: 18.172.IN-ADDR.ARPA
.
.
.
Jan 15 16:48:59 mail named[4722]: managed-keys-zone: loaded serial 1458
Jan 15 16:48:59 mail named[4722]: zone X.X.122.in-addr.arpa/IN: loaded serial 0
Jan 15 16:48:59 mail named[4722]: zone mail.example.com/IN: loaded serial 0
Jan 15 16:48:59 mail named[4722]: all zones loaded
Jan 15 16:48:59 mail named[4722]: running
Jan 15 16:48:59 mail systemd: Started Berkeley Internet Name Domain (DNS).
Jan 15 16:48:59 mail systemd: Starting Telnet Server...
Jan 15 16:48:59 mail systemd: Started Telnet Server.
Jan 15 16:48:59 mail named[4722]: error (network unreachable) resolving '52.146.191.201.in-addr.arpa/PTR/IN': 2001:67c:e0::1#53
Jan 15 16:49:00 mail named[4722]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:13c7:7002:3000::10#53
Jan 15 16:49:00 mail named[4722]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:dc0:1:0:4777::140#53
Jan 15 16:49:00 mail named[4722]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:13c7:7002:3000::11#53
Jan 15 16:49:00 mail named[4722]: error (network unreachable) resolving 'ns3.afrinic.net/AAAA/IN': 2001:dc0:2001:a:4608::59#53
 
Old 01-15-2017, 10:02 AM   #2
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,

1.
The reverse zone file looks correct.
If the reverse resolution doesn't work, you should ask you ISP to either delegate to your dns the subnet you bought from them, or tell them to do the reverse delegation for your host(s). The following should tell you who is responsible for your subnet (or IPs)
Code:
dig ns X.X.122.in-addr.arpa

2.
Quote:
Jan 15 16:48:59 mail named[4722]: error (network unreachable) resolving '52.146.191.201.in-addr.arpa/PTR/IN': 2001:67c:e0::1#53
Jan 15 16:49:00 mail named[4722]: error (network unreachable) resolving 'ns2.lacnic.net/A/IN': 2001:13c7:7002:3000::10#53
The above error is normal if you're not using ipv6. You can disable it from your system and you'll be ok.


Also note:
Quote:
zone "mail.example.com" IN {
type master;
file "fwd-example.zone";
allow-update { none; };
};
The forward zone name is wrong. You just need example.com as zone name and the in the zone file you declare the various hosts, like mail etc.
 
Old 01-16-2017, 01:03 AM   #3
Shyamal796
LQ Newbie
 
Registered: Nov 2016
Location: Dhaka
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks bathory.

I changed my forward zone file name "mail.example.com" to "example.com".


These are the NS and PTR Record Informations:

Quote:
# dig -x 122.X.X.102

;; ANSWER SECTION:
102.X.X.122.in-addr.arpa. 86400 IN PTR mail.example.com.

;; AUTHORITY SECTION:
X.X.122.in-addr.arpa. 86400 IN NS mail.example.com.

;; ADDITIONAL SECTION:
mail.example.com. 86400 IN A 122.X.X.102


# host 122.X.X.102
102.X.X.122.in-addr.arpa domain name pointer mail.example.com.

# nslookup
> 122.X.X.102
Server: 122.X.X.102
Address: 122.X.X.102#53

102.X.X.122.in-addr.arpa name = mail.example.com.
>
> mail.example.com
Server: 122.X.X.102
Address: 122.X.X.102#53

Name: mail.example.com
Address: 122.X.X.102
Is DNS Configraton ok now???

But when i am trying to lookup reverse dns from windows machine can not find:
Quote:
C:\Users\BCL >nslookup 122.X.X.102
Server: ns1.wimax.com
Address: 58.X.X.24

*** ns1.wimax.com can't find 122.X.X.102: Non-existent domain
Now what can i do?

Last edited by Shyamal796; 01-16-2017 at 01:18 AM.
 
Old 01-16-2017, 02:17 AM   #4
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
Yes, the reverse resolution works now looking at dig, host and nslookup output


Quote:
But when i am trying to lookup reverse dns from windows machine can not find:
Quote:
C:\Users\BCL >nslookup 122.X.X.102
Server: ns1.wimax.com
Address: 58.X.X.24

*** ns1.wimax.com can't find 122.X.X.102: Non-existent domain
Now what can i do?
Apparently ns1.wimax.com is not yet updated, or it's a cached response.
If you're the admin of ns1.wimax.com you canflush its cache, or else use a different dns server for the windows box and/or flush also the (windows box) dns cache
 
Old 01-16-2017, 03:40 AM   #5
Shyamal796
LQ Newbie
 
Registered: Nov 2016
Location: Dhaka
Posts: 9

Original Poster
Rep: Reputation: Disabled
Again thanks bathory.

My problem is solved now.

Now tell me how can i disable ipv6 resolving?

Already i disabled from /etc/named.conf
Quote:
#listen-on-v6 port 53 { ::1; };
 
Old 01-16-2017, 04:19 AM   #6
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
First hit on google
 
Old 01-17-2017, 04:06 AM   #7
Shyamal796
LQ Newbie
 
Registered: Nov 2016
Location: Dhaka
Posts: 9

Original Poster
Rep: Reputation: Disabled
Problem Solved !!!!

Thanks brother Bathory.
My Problem is solved now.

I will talk to my ISP to help me for RPT resolving problem sollution.

Thank you so much...
 
Old 01-18-2017, 12:33 AM   #8
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
Quote:
Originally Posted by Shyamal796 View Post
Thanks brother Bathory.
My Problem is solved now.

I will talk to my ISP to help me for RPT resolving problem sollution.

Thank you so much...
Cool!
You may mark the thread as "SOLVED" from the "Thread Tools" menu on top of the page.

Cheers
 
  


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
ERROR: No reverse DNS (PTR) entries. The problem MX records are: AgLiAn Linux - Server 5 09-30-2014 03:04 PM
No Reverse-DNS (PTR) is assigned to IP agriz Linux - Server 4 06-25-2013 03:27 AM
[SOLVED] DNS: A Record and PTR Record hydraMax Linux - Server 4 12-21-2010 10:28 PM
reverse DNS query - PTR 91change Linux - Networking 3 10-05-2008 03:28 AM
How to format DNS PTR record ? pcom Linux - Networking 2 07-01-2004 11:59 PM

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

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