Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: User of dns-api.org PTR lookup over http service broken  (Read 1364 times)

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
User of dns-api.org PTR lookup over http service broken
« on: July 21, 2018, 11:26:21 AM »

Why is http://dns-api.org/PTR/8.8.8.8 broken? I use the dns-api.org free DNS query over http services and for example http://dns-api.org/AAAA/dns-api.org works. But with a PTR lookup I just get an NXDOMAIN result all the time.
« Last Edit: July 23, 2018, 02:35:36 AM by Weaver »
Logged

johnson

  • Reg Member
  • ***
  • Posts: 838
Re: dns-api.org PTR lookup over http service broken
« Reply #1 on: July 21, 2018, 12:18:56 PM »

Have never used this service but from this github page:

https://github.com/skx/dns-api-go

Quote
PTR (reverse-DNS) requests must be submitted in reverse-format, for example:

    https://dns-api.org/ptr/100.183.9.176.in-addr.arpa.
    https://dns-api.org/ptr/0.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.3.8.0.6.1.5.1.0.8.f.4.0.1.0.a.2.ip6.arpa.

I'm not sure what special sauce ".in-addr.arpa" adds or if I'm even reading it right, but:

https://dns-api.org/ptr/8.8.8.8.in-addr.arpa

seems to work just fine.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: user of dns-api.org PTR lookup over http service broken
« Reply #2 on: July 21, 2018, 02:01:53 PM »

ah - that is the standard format for making PTR requests - it just doesn't do it for you.

Well done, what a fool I was.
« Last Edit: July 23, 2018, 02:36:49 AM by Weaver »
Logged

johnson

  • Reg Member
  • ***
  • Posts: 838
Re: dns-api.org PTR lookup over http service broken
« Reply #3 on: July 21, 2018, 02:18:44 PM »

Didn't make any sense to me either, if you are already specifying a reverse lookup with /PTR/ why not add the in-addr.arpa automatically?
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: user of dns-api.org PTR lookup over http service broken
« Reply #4 on: July 21, 2018, 07:08:53 PM »

indeed, I had to write a load of extra code because of that - to reverse the address and carve it up appropriately.
« Last Edit: July 23, 2018, 02:36:17 AM by Weaver »
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: user of dns-api.org PTR lookup over http service broken
« Reply #5 on: July 21, 2018, 08:54:19 PM »

Thank you to johnson anyway - at least someone is awake, what an utter fool I am. I have written a ptr lookup tool for the ipad based on this service, as I don't have access to the low level routines required to do it properly. (If I were to learn Python and use Pythonista then that might be a different matter tho.)

I have put in a caching / memoization module so it does not go to the network every single time. It is very cheap though. The next stage would be to add lifetimes to the cache entries and do things properly, as they should be done.
« Last Edit: July 23, 2018, 02:36:31 AM by Weaver »
Logged