Skip to Content

Scripting example in Jitterbit App Builder - DNS

This example demonstrates how to perform a DNS lookup to validate a given host name.

Table schema

Column Data Type Primary Key Auto-generate Nullable
HostName NVARCHAR(100) No No No

Script

using System.Net;

string hostName = Row["HostName"].GetValueAsString();

try
{
    IPAddress[] ips = await Dns.GetHostAddressesAsync(hostName);

    if (ips.Length == 0)
    {
        Fail();
    }
}
catch
{
    Fail();
}