Reverse DNS lookup

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Reverse DNS lookup

Postby steve1376656734 » Tue Oct 24, 2017 5:16 pm

Hi,

Can anyone suggest the best way to do a reverse DNS lookup from within Servoy? I want to get the hostname for my client connection but all the plugins (UserManager, IT2BE_tools, clientmanager) do not give the correct hostname (as well as only varying success with the client IP address!).

I have looked at (what I think) are all the obvious places for a function call that will give me this capability but nothing jumps out as being correct.

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 202
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: Reverse DNS lookup

Postby rgansevles » Fri Oct 27, 2017 8:35 am

Hi Steve,

You could write a java plugin for it, or use the httpclient plugin to resolve the hostname of an ip using a web service.

Why do you need to know the hostname of the client?

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1867
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Reverse DNS lookup

Postby steve1376656734 » Mon Oct 30, 2017 5:35 pm

I need to know if a particular client session is coming from a specific place. The source does not have a fixed IP address and updates a dynamic DNS service whenever the IP changes so I need to do a nslookup of the dynamic DNS name to see if the IP address of the client session matches.

Is there any reason you can think of that I cannot use the following rather than write a plugin or a web service):

var inetAddr = Packages.java.net.InetAddress.getByName("myDyns.noip.com");

Thanks
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 202
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: Reverse DNS lookup

Postby rgansevles » Mon Oct 30, 2017 10:04 pm

Steve,

You can use java packages directly from js.
But your example is not reverse lookup.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1867
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Reverse DNS lookup

Postby steve1376656734 » Mon Oct 30, 2017 10:52 pm

:D Bad example on my part - should have put:
Code: Select all
var inetAddr = Packages.java.net.InetAddress.getByName("123.123.123.123");


But thanks for confirming that I can call the java package directly - this is sooooo much simpler than a web service or plugin. Are there any circumstances where you should not use the underlying Java directly?
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 202
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: Reverse DNS lookup

Postby Harjo » Tue Oct 31, 2017 10:33 am

Harjo Kompagnie
Direct ICT / Servoy Hosting / ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
User avatar
Harjo
 
Posts: 4290
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests

cron