Masum Nishat
Masum Nishat

Reputation: 167

PTR record is confusing

I am new in PTR configuration. I dont understand what is going on in this records..

$ip_initial = gethostbyname('radio-lolipop.com'); //returns 149.56.132.111
$domain = gethostbyaddr($ip_initial); //returns 111.ip-149-56-132.net
$ip_final = gethostbyname($domain); // returns 149.56.132.111
print_r(dns_get_record($domain)); //in A record it is 149.56.132.111
print_r(dns_get_record('radio-lolipop.com')); //in A record it is 149.56.132.111

I found matched result here

I found unmatched result here

here is DNS entry lookup found in dnsgoodies.com

here is DNS entry lookup found in dnsgoodies.com

here is reverse lookup found in dnsgoodies.com. "Authoritative answers can be found from:" is null here is reverse lookup found in dnsgoodies.com

I am totally confused with those results.

Questions:

  1. Is my PTR correct? If not how i will correct it?

  2. What is the correct code to check PTR record of my domain in php?

  3. Is my reverse DNS accessible by all mail client? how they are handling this?

Upvotes: 2

Views: 3684

Answers (2)

Nadir Latif
Nadir Latif

Reputation: 3773

  1. Your PTR records are not correct. You need to add a new PTR record to your DNS settings. But before that you need to make sure that your Hosting Provider supports PTR records. See PTR Records for more information

  2. The correct code for checking PTR records from Php is: dns_get_record("ip address", DNS_PTR); . See the documentation for dns_get_record for more information. You can use the gethostbyaddr function to get reverse dns information for a host.

  3. Email servers will not reliably deliver email if the a correct PTR record does not exist. The ip address that your domain name resolves to must resolve back to the domain name.

Upvotes: 1

Dusan Bajic
Dusan Bajic

Reputation: 10879

You can't check PTR record of your domain because domains/hostnames do not have PTR records, only IP addresses do.

You can check for PTR record of IP address 149.56.132.111 (but that is not 'your' IP address, IP address belongs to a network provider, in this particular case it is Canada Montreal Ovh Hosting Inc.)

Reverse DNS lookups for IPv4 addresses use the special domain in-addr.arpa. In this domain, an IPv4 address is represented as a concatenated sequence of four decimal numbers, separated by dots, to which is appended the second level domain suffix .in-addr.arpa. You can find authoritative Name servers for this IP address:

[centos@ip-172-31-24-14 ~]$ dig NS  132.56.149.in-addr.arpa. @8.8.4.4

;; ANSWER SECTION:
132.56.149.in-addr.arpa. 86399  IN      NS      dns10.ovh.ca.
132.56.149.in-addr.arpa. 86399  IN      NS      ns10.ovh.ca.

You can query Authoritative name Server directly (or any other name server) to get the PTR record value:

[centos@ip-172-31-24-14 ~]$ dig PTR 111.132.56.149.in-addr.arpa. @ns10.ovh.ca

;; ANSWER SECTION:
111.132.56.149.in-addr.arpa. 86400 IN   PTR     111.ip-149-56-132.net.

Upvotes: 2

Related Questions