Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
Hi,
what is the function to resolve the dns name of a site (similar to nslookup) ?
I 'm looking for a script to obtain the IP address from a name server.
BR,
Alberto
KNX Advanced Partner + Tutor
Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
Thanks...TOP
KNX Advanced Partner + Tutor
Posts: 41
Threads: 4
Joined: Jan 2020
Reputation:
4
Hi,
I've tried suggested code but it returns only single IP for a domain. Is there a way to get all resolved IPs for a given name?
also how resource intensive for LM is to resolve dozens (double digit number) names in a script? or it's best to offload this task to another platform?
Posts: 7720
Threads: 42
Joined: Jun 2015
Reputation:
446
There's no way of getting all IP addresses for a given host. Why do you need to get all? If some kind of load balancing is used then the list is not static and can change over time.
DNS requests are very lightweight and should not cause high load. You can put a small delay between them so there are no CPU load spikes.
Posts: 7720
Threads: 42
Joined: Jun 2015
Reputation:
446
You can run nslookup via os.execute().
Posts: 7720
Threads: 42
Joined: Jun 2015
Reputation:
446
Yes but I doubt that you need to execute them all the time.