How can I run DNS lookup from a server-side script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2022 11:23 PM
Hi,
Is it possible to run DNS lookup to a specific hostname from the server-side scripts? My intention is trying to identify if a hostname which is existent in the CMDB is still valid (registered in DNS) or not (usually identified as Bad Hostname).
The approach might not be the best one. You are very welcome to share any other methodologies if you have.
Thanks,
Endmost
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2022 11:52 PM
Hi
basically server-side scripts cannot perform a DNS lookup.
But you could try to find an internet service which allows an lookup via REST request. Or you use a MID Server but that way you would have huge efforts.
Kind regards
Maik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 01:53 AM
Endmost,
Assuming you are meaning on an internal network, I would probably look to design something where either IntegrationHub (PowerShell Step) or Orchestration (Think this would need a custom activity) run a powershell command from the MID server onto the target network. This will be dependent on what you are licenced for, you will need at least IntegrationHub Professional.
You can probably make use of the Resolve-DnsName PS cmdlet.
Hope this is of some help,
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 05:40 AM
Thanks Richard. That gives me the direction. I am not sure if I have IntegrationHub Professional, but I do know I have Orchestration. I think I need to spend some time learning how to utilize the Orchestration to run the powershell commands. Or, maybe you can have a brief instruction here showing me how to get started.
Thanks,
Endmost

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 02:42 AM
Hi,
The discovery already does DNS lookup why do you need to do it additionally? Does these CI's are not discovered by Servicenow?
Regards,
Vivek