IP Address Macro Related Functions
Prerequisites
The Qarbine Administrator must define several settings to use these IP address related macro functions. Instructions to do this are within the Tools;Administration Tool area of http://doc.qarbine.com.
Overview
Qarbine can be configured to obtain information about a public IP address regarding:
- DNS to IP resolution,
- “who is?” and
- geographic location.
An easy way to test these and many other macro functions independent of a template is to create a new data source.
Use the following data service and database values.
In the query specification area author a macro function that returns a list of some sort. FOr a function that does not return a list, wrap it with in “listWith( … )”.
Macro Functions
DNS Resolution
The signature for this function is
ipAddress = dnsResolve(host)
It performs a DNS resolution of the name to an IP address relative to the Qarbine server. DNS resolution for any given DNS name may vary depending on geographic location and other factors.
Enter the following
listWith(dnsResolve("disney.com") )
A sample result is shown below.
Who Is?
The signature for this function is
{stuff} = whoIs(host)
It performs an ICANN lookup for the given host.
Enter the following
listWith(whois("disney.com") )
A sample result is shown below.
Select the row to see its details on the right side.
This service returns information from the ICANN database. A sample portion for google.com is shown below.
{
Domain Name: google.com
Registry Domain ID: 2138514_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.markmonitor.com
Registrar URL: http://www.markmonitor.com
Updated Date: 2019-09-09T08:39:04-0700
Creation Date: 1997-09-15T00:00:00-0700
Registrar Registration Expiration Date: 2028-09-13T00:00:00-0700
Registrar: MarkMonitor, Inc.
Registrar IANA ID: 292
Registrar Abuse Contact Email: abusecomplaints@markmonitor.com
Registrar Abuse Contact Phone: +1.2083895770
Registrant Organization: Google LLC
Registrant State/Province: CA
Registrant Country: US
Registrant Email: Select Request Email Form at Domain Status: clientUpdateProhibited (https://www.icann.org/epp#clientUpdateProhibited)
Domain Status: clientTransferProhibited (https://www.icann.org/epp#clientTransferProhibited)
…
}
IP to Geo Location
The signature for this function is
about = ipLocation(ipAddress [,granularity] )
It attempts to provide a geographic coordinate with longitude and latitude for the given public IP address. Qarbine uses a local MaxMind database for country, city, and ASN lookups. The lookup options may be ‘country’,’ASN’, or ’city’.
The usual usage in a suppressed cell is
about = ipLocation('130.211.198.204')
and then have other cells interact with the “about” variable.
To test this in the Data Source Designer run
listWith( ipLocation( "130.211.198.204") )
Sample results are shown below.
The details are shown below.
You can combine these various functions as shown below.
listWith( ipLocation( dnsResolve("disney.com") ) )
Sample ‘country’ output is shown below.
continentCode: 'OC',
continentName: 'Oceania', ← English
countryCode: 'US', ← the ISO code.
countryName: 'United States' ← English
The “city” output also has the following information.
location: {
accuracyRadius: 1000,
latitude: 37.751,
longitude: -97.822,
timeZone: 'America/Chicago'
}
The ASN output looks like the following
Asn {
autonomousSystemNumber: 217,
autonomousSystemOrganization: 'UMN-SYSTEM',
ipAddress: '128.101.101.101',
network: '128.101.0.0/16'
}