Written by

Manager, Application Services at InterSystems
Question Ben Spead · Dec 21, 2019

API for looking up server name based on IP?

Does anyone know of an API that will do a hostname look-up based on IP?  We could of course use call-out but the format of the results vary based on OS and if there is already an ObjectScript tool which will parse this then we'd rather use what is already available.

Thanks!
Ben

Comments

Jenna Makin · Dec 21, 2019

Ben

Check %SYSTEM.INetInfo.   I think it probably contains a method to serve your purpose 

0
Robert Cemper  Dec 22, 2019 to Jenna Makin

@Kenneth.Poindexter8571   this is correct
though the result might be disappointing.
 
See: >ping www.intersystems.com

Antwort von 172.227.166.122: Bytes=32 Zeit=22ms TTL=55

But:

USER>w $system.INetInfo.AddrToHostName($C(172,227,166,122))
a172-227-166-122.deploy.static.akamaitechnologies.com
USER>

 

0
Jenna Makin  Dec 22, 2019 to Robert Cemper

Unfortunately name <-> IP aren't always one to one 

0
Sergei Shutov  Dec 22, 2019 to Robert Cemper

Despite being disappointing, this is actually a correct result - you would get the same with OS level tools

0