Reverse DNS Look Up

Hi

I’m trying to get the IP address of a domain name, so I can add the IP to my firewall but I can’t seem to get the dns node to work - node-red-contrib-dns (node) - Node-RED

Is anyone using this successfully for reverse look ups ?

I’m simple trying to send the domain name (e.g www.google.com) via an inject node to the dns node (set to Reverse) to see if it can return the IP address via debug node ?

I’ve tried variations of the domain name, http:/www.google.com, www.google.com, google.com - it all I seem to get in return is this error, and nothing reaches the debug node

08/03/2020, 18:21:12
msg : error
"Error: getHostByAddr EINVAL"

That makes no sense, so you get the error.

www.google.com is not an .in-addr.arpa address.

Either you should do a simple lookup, or rethink what you want to achieve.

Exactly this.

domain -> exec node: nslookup -> output. Or use dig +short google.com instead.

[{"id":"aa5d9ffd.ef58b8","type":"inject","z":"a8be5bbf.2423a","name":"google.com","topic":"","payload":"google.com","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":286,"y":336,"wires":[["5c0eeb15.cedd2c"]]},{"id":"5c0eeb15.cedd2c","type":"exec","z":"a8be5bbf.2423a","command":"nslookup","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":442,"y":336,"wires":[["cb73c5b5.fca318"],[],[]]},{"id":"cb73c5b5.fca318","type":"debug","z":"a8be5bbf.2423a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":602,"y":336,"wires":[]}]

I'm not sure what you wanted to say in your reply.

@nodecentral needs to select "lookup" instead of "reverse" in the dns node.

Thanks all, the 'lookup' option worked a treat !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.