I recently needed to verify the outgoing IP address to a Service-now.com instance. Since SNC instances are hosted in the cloud you cannot just ping their instance name to get the IP address. Their incoming addresses and outgoing addresses will be different (among other things).

In order to easily get the IP address of the instance as it communicates with 3rd party web services I created a Script Module in a utility application that does an HTTP connection to a special web url that I created.

To create this script all you need to do is create a module inside an application inside the Service-now.com instance. Set the module to be a Script (in the Argument field).

Here is the script you will save:

1
2
3
4
5
6
7
8
9
10
var url = new Packages.java.net.URL("https://john-james-andersen.com/tools/connection.php");
var isr = new Packages.java.io.InputStreamReader(url.openStream());
var inp = new Packages.java.io.BufferedReader(isr);

var inputLine = "";

while (inputLine = inp.readLine()) {
  gs.log(inputLine);
}
inp.close();

Once you run the script you will get a result similar to the following below: