When using the internet, we all use DNS records to resolve the name of websites so our computer and/or browser knows that when we go to https://binaryfigments.com the browser has to go to the webserver with the IP address 126.96.36.199 of the IPv6 address 2a01:448:1003::130.
There is also a way to get a name behind an IP address. This is also a DNS record named a PTR record. PTR stand for Pointer Record, also known as reverse DNS record. If you do reversed lookup for a IP address, you will get the name behind it. There records are commonly used by mail systems to check if the sending mail server is who he is that he say he is.
For example, if we do a look up to the name of SMTP server of my domain provider we get the following results:
$ dig A filter01.networking4all.net +short 188.8.131.52
Or for IPv6:
$ dig AAAA filter01.networking4all.net +short 2a01:448:1:1002::8
With the host command:
$ host filter01.networking4all.net filter01.networking4all.net has address 184.108.40.206 filter01.networking4all.net has IPv6 address 2a01:448:1:1002::8
These are normal lookup’s checking what IP address is behind what full qualified domain name. If we want to do a reversed lookup to these addresses, we can also use the dig or host command.
$ dig -x 220.127.116.11 +short filter01.networking4all.net. $ dig -x 2a01:448:1:1002::8 +short filter01.networking4all.net.
$ host 18.104.22.168 22.214.171.124.in-addr.arpa domain name pointer filter01.networking4all.net. host 2a01:448:1:1002::8 126.96.36.199.0.0.0.0.0.0.0.0.0.0.0.0.188.8.131.52.184.108.40.206.220.127.116.11.1.0.a.2.ip6.arpa domain name pointer filter01.networking4all.net.
As you can see in the results of the last host commands, PTR records have a bit of a strange notation. These PTR records are the IP address, but in a reversed notation in the zone in-addr.arpa, for IPv4 and for IPv6 the zone ip6.arpa.
18.104.22.168 22.214.171.124 (.in-addr.arpa)
The PTR records are in the DNS servers of the network maintainer. If I want to get a PTR record on the IP address that I have from my provider 126.96.36.199 and add the name binaryfigments.com to it, I will have to ask them to set it for me. Even better it is if you can set it up on your own in a portal. The provider will set this PTR record in their name server. If you have a IP subnet, you can possible use your own nameservers.
To get the zone you are in you can run the command:
$ dig 188.8.131.52.in-addr.arpa. ; <<>> DiG 9.8.3-P1 <<>> 184.108.40.206.in-addr.arpa. ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21458 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;220.127.116.11.in-addr.arpa. IN A ;; AUTHORITY SECTION: 93.249.213.in-addr.arpa. 1799 IN SOA ns1.networking4all.com. hostmaster.yourdomainprovider.net. 2016081703 14400 3600 1209600 7200 ;; Query time: 48 msec ;; SERVER: 18.104.22.168#53(22.214.171.124) ;; WHEN: Wed Aug 17 14:47:08 2016 ;; MSG SIZE rcvd: 136
And for IPv6:
$ dig 0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.126.96.36.199.188.8.131.52.1.0.a.2.ip6.arpa ; <<>> DiG 9.8.3-P1 <<>> 0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.184.108.40.206.220.127.116.11.1.0.a.2.ip6.arpa ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 806 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;0.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.18.104.22.168.22.214.171.124.1.0.a.2.ip6.arpa. IN A ;; AUTHORITY SECTION: 126.96.36.199.1.0.a.2.ip6.arpa. 1799 IN SOA ns1.networking4all.com. hostmaster.networking4all.com. 2016081706 3600 3600 1209600 7200 ;; Query time: 131 msec ;; SERVER: 188.8.131.52#53(184.108.40.206) ;; WHEN: Wed Aug 17 14:42:22 2016 ;; MSG SIZE rcvd: 159
At the authority section you see the SOA of the zone of the IP address. The name server in the SOA is the authoritive name server for the zone of your IP address.
Zone for my IPv4: 93.249.213.in-addr.arpa.
Zone for my IPv6: 220.127.116.11.1.0.a.2.ip6.arpa.
The primary name server for this zone is
ns1.networking4all.com, and there you have to add the right PTR record.
The RIPE is the organization that manages the IP subnets in the region I am in. My provider, Networking4all, need to add an DOMAIN object in de database off the RIPE with the right name servers in it.
You can search it here: https://apps.db.ripe.net/search/query.html?searchtext=93.249.213.in-addr.arpa#resultsAnchor
This is the DOMAIN object that you will find: https://apps.db.ripe.net/search/lookup.html?source=ripe&key=93.249.213.in-addr.arpa&type=domain
You can see, PTR records have a slightly different approach for looking up. It is important to set a right PTR record for your IP address on your server if you user services like e-mail and DNS.