Search
Filters
Close

NSLookup( )

=NsLookup( ) IP Tools for Excel Sheet Function to NsLookup
 

How to check, test and evaluate DNS lookup in Microsoft Excel. Supports IPv4 and IPv6 DNS Lookup. Tools for MX record lookup including priorities and ttl

 

  

NsLookup( )
                     additional features now supported in ipte version 3.5

Performs DNS name resolution for the target host or URL/URI. Return results and response time for DNS server performance testing. Local host files are not used. Resolution results are not placed into the system DNS cache. System defined or argument specified name servers are used

=NsLookup(TargetURL, [ReturnType], [RecordType], [TimeOut], [DNS_SERVER_IP])

>NsLookup Argument RecordType

>NsLookup Argument TimeOut

>NsLookup Argument DNS_Server_IP

>NsLookup Usage Examples

>NsLookup Notes

Arguments

TargetURL Required

May be URL, Host Name or IP Address.  Supports IPv6 addresses

ReturnType Optional - default is 2

0  TrueFalse = TRUE/FALSE

If the TargetURL is resolved then TRUE is returned else the return is FALSE

1  Time = time in milliseconds

Time taken in milliseconds to receive the result from the name server. If the result fails -1 is returned

2  Record = first record, data field

Returns the first record returned by the name server for the requested record type. The data field of the answer is returned. For all 2x return types, if RecordType is omitted then the type A is returned for a host address and the type PTR is returned for an IP address

20  RecordData = first record, data field

Same as 2. Returns the first record returned by the name server for the requested record type. The data field of the answer is returned

21  RecordName = first record, name field

Returns the first record returned by the name server for the requested record type. The name field of the answer is returned

22  RecordTTL = first record, ttl field

Returns the first record returned by the name server for the requested record type. The ttl field of the answer is returned.  TTL is time to live. TTL returned value is an integer representing seconds

23  RecordType = first record, type field

Returns the first record returned by the name server for the requested record type. The type field of the answer is returned.  Type is an integer and represents a record type defined by various RFCs.  Link to Domain Name System Paramaters at IANA:  http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml

24  RecordAllFields = first record, data field<fs>name field<fs>ttl field<fs>type field

Returns the first record returned by the name server for the requested record type. The data, name, ttl and type fields are returned separated by <fs>.  Note about <fs> below

25  RecordAllFieldsDescriptions = first record, data field<fs>name field<fs>ttl field<fs>type field

Returns the first record returned by the name server for the requested record type. The data, name, ttl and type fields are returned separated by <fs>.  Note about <fs> below. The fields are decorated with descriptions prefixed Data: Name: TTL: Type:

3  AnswerRecords = all records returned, data field, delimited by <fs>

Returns all records returned by the name server for the requested record type. The data field of the answer is returned. For all 3x return types, if RecordType is omitted then the type A is returned for a host address and the type PTR is returned for an IP address

30  AnswerRecordsData = all records returned, data field, delimited by <fs>

Same as 3. Returns all records returned by the name server for the requested record type. The data field of the answer is returned

31  AnswerRecordsName = all records returned, name field, delimited by <fs>

Returns all records returned by the name server for the requested record type. The name field of the answer is returned

32  AnswerRecordsTTL = all records returned, ttl field, delimited by <fs>

Returns all records returned by the name server for the requested record type. The ttl field of the answer is returned.  TTL is time to live. TTL returned value is an integer representing seconds

33  AnswerRecordsType = all records returned, type field, delimited by <fs>

Returns all records returned by the name server for the requested record type. The type field of the answer is returned.  Type is an integer and represents a record type defined by various RFCs.  Link to Domain Name System Paramaters at IANA:  http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml

34  AnswerRecordsAllFields = all records returned, data field<fs>name field<fs>ttl field<fs>type field<fs> 

Returns all records returned by the name server for the requested record type. The data, name, ttl and type fields are returned separated by <fs>.  Note about <fs> below

35  AnswerRecordsAllFieldsDescriptions = all records returned, data field<fs>name field<fs>ttl field<fs>type field<fs>  

Returns all records returned by the name server for the requested record type. The data, name, ttl and type fields are returned separated by <fs>.  Note about <fs> below. The fields are decorated with descriptions prefixed Data: Name: TTL: Type:

6  MXRecords = all records returned, hostname, delimited by <fs>

Returns all records returned by the name server for the MX record type. The hostname field of the answer is returned

60  MXRecordsHostName = all records returned, hostname field, delimited by <fs>

Same as 6. Returns all records returned by the name server for the MX record type. The hostname field of the answer is returned

61  MXRecordsIPAddress = all records returned, ipaddress field, delimited by <fs>

Returns all records returned by the name server for the MX record type. The ipaddress field of the answer is returned

62  MXRecordsPreferences = all records returned, preference field, delimited by <fs>

Returns all records returned by the name server for the MX record type. The preference field of the answer is returned

64  MXRecordsAllFields = all records returned, hostname field<fs>ipaddress field<fs>preference field<fs> 

Returns all records returned by the name server for the MX record type. The hostname, ipaddress, and preference fields are returned separated by <fs>.  Note about <fs> below

65  MXRecordsAllFieldsDescriptions = all records returned, hostname field<fs>ipaddress field<fs>preference field<fs>    

Returns all records returned by the name server for the MX record type. The hostname, ipaddress, and preference fields are returned separated by <fs>.  Note about <fs> below. The fields are decorated with descriptions prefixed HostName: IPAddress: Preference:

99  FailureReason = error reason

Returns a text string describing the error. If there was no error then the string #ipte_NO-ERROR is returned

RecordType Optional – default is PTR if TargetURL is an IPv4 or IPv6 address otherwise A

1  A = address record

Returns a 32 bit IPv4 address

2  NS = name server

Returns an authoritive name server

5  CNAME = canonical name

Returns a canonical name which is an alias of one name to another

6  SOA = start of authority or authority record

Returns the fields associated with the start of authority record delimited by <fs> The fields are mname, rname, serial, refresh, retry, expire and minimum.

7  MB = mailbox domain name

Returns a mailbox domain name

8  MG = mail group member

Returns a mail group member

9  MR = mail rename domain

Returns mail rename domain

10  NULL = null RR

Returns a null

11  WKS = well known service

Returns a well known service description

12  PTR = pointer record

Returns a pointer to a canonical name or commonly the reverse DNS lookup

13  HINFO = host information

Returns host information

14  MINFO = mailbox or mail list information

Returns mailbox or mail list information

15  MX = mail exchange

Returns a mail exchange record but not the entire record type. Use this type to retrieve the records TTL value. Use the MX return types 6, 60 - 65 for complete MX record lookup information

16  TXT = text strings

Returns text strings

17  RP = resposible person

Returns responsible person

18  AFSDB = afs data base location

Returns afs data base location

19  X25 = x.25 psdn address

Returns x.25 psdn address

20  ISDN = isdn address

Returns isdn address

21  RT = route through

Returns route through

22  NSAP = nsap address

Returns nsap style A record

23  NSAP = nsap pointer

Returns nsap domain name pointer

24  SIG = security signature

Returns security signature

25  KEY = security key

Returns security key

26  PX = x.400 mail mapping

Returns x.400 mail mapping information

27  GPOS = geographical position

Returns geographical position information

28  AAAA = IP6 address

Returns IPv6 addresses. Reference: RFC 3596  http://tools.ietf.org/html/rfc3596

29  LOC = location information

Returns location information

30  NXT = OBSOLETE next domain

Returns next domain information

31  EID = end point identifier

Returns end point identifier information

32  NIMLOC = nimrod locator

Returns nimrod locator information

33  SRV = server selection

Returns server selection information

34  ATMA = atm address

Returns atm address information

35  NAPTR = naming authority pointer

Returns naming authority pointer information

36  KX = key exchanger

Returns key exchanger information

37  CERT = cert

Returns server cert information

39  DNAME = dname selection

Returns dname information

40  SINK = sink information

Returns sink information

41  OPT = opt information

Returns opt information

42  APL = apl information

Returns apl information

43  DS = delegation signer information

Returns delegation signer information

44  SSHFP = ssh key fingerprint

Returns ssh key fingerprint

45  IPSECKEY = ipsec key

Returns ipsec key

46  RRSIG = rrsig

Returns rrsig information

47  NSEC = nsec information

Returns nsec information

48  DNSKEY = dns key information

Returns dns key information

49  DHCID = dhcid information

Returns dhcid information

50  NSEC3 = nsec3 information

Returns nsec3 information

51  NSEC3PARAM = nsec3 param information

Returns nsec3 param information

52  TLSA = tlsa information

Returns tlsa information

55  HIP = host identity protocol information

Returns host identity protocol information

56  NINFO = ninfo information

Returns ninfo information

58  TALINK = trust anchor link information

Returns trust anchor link information

59  CDS = child ds information

Returns child ds information

60  CDNSKEY = dns keys information

Returns dns keys the child wants

61  OPENPGPKEY = open pgp key

Returns open pgp key

99  SPF = sender policy framework

Returns sender policy framework supporting simple email validation information
Reference: RFC 7208  http://tools.ietf.org/html/rfc7208

100  UINFO = uinfo information

Returns uinfo information

101  UID = uid information

Returns uid information

102  GID = gid information

Returns gid information

103  UNSPEC = unspec information

Returns unspec information

104  NID = nid information

Returns nid information

105  L32 = l32 information

Returns l32 information

106  L64 = l64 information

Returns l64 information

107  LP = lp information

Returns lp information

108  EUI48 = eui48 information

Returns eui48 information

109  EUI64 = eui64 information

Returns eui64 information

249  TKEY = transaction key

Returns transaction key

250  TSIG = transaction signature

Returns transaction signature

251  IXFR = incremental transfer

Returns nothing - ipte not implemented

252  AXFR = automatic transfer

Returns nothing - ipte not implemented

253  MAILB = mailbox related information

Returns mailbox related rrs mb mg or mr

254  MAILA = mail agent related information

Returns mail agent information

255  ANY = all records

Returns all records the server or cache has available

255  ALL = all records

Returns all records the server or cache has available

256  URI = uri information

Returns uri information

257  CAA = certificate authority restriction

Returns certificate authority restriction information

32768  TA = dns sec trust authorities

Returns dns sec trust authorities

32769  DLV = dns sec lookaside validation

Returns dns sec lookaside validation
 

 

TimeOut Optional - default is 1

Integer value 1 to 25. Timeout value in seconds. The amount of time to wait for a name server response before returning a timeout error


 

DNS_SERVER_IP Optional – default system defined name servers are used

IPv4 Address

The specified IP address will be used as the name server to resolve names. If an invalid IPA is specified then the return is #ipte_ARG5-ERROR. The specified name server will be used in this function only. This will be the only name server tried
 

Usage Examples

=NsLookup(“http://www.cisco.com”)

Performs a lookup on the TargetURL host www.cisco.com and returns the first A record returned from the name server

=NsLookup(“184.87.144.170”)

Performs a lookup on the TargetURL host 184.87.144.170 and returns the first PTR record returned because the host is a IPv4 address

=NsLookup("http://att.com","MXRecords")

Performs a lookup on the TargetURL which resolves to att.com and returns the host names for the requested type MX records delimited by <fs>. Consider formatting cell as Excel Wrap Text

=NsLookup("http://att.com","AnswerRecordsTTL" ,"MX")

Performs a lookup on the TargetURL which resolves to att.com and returns the TTL field for the requested type MX delimited by <fs>. Consider formatting cell as Excel Wrap Text

=NsLookup("www.cisco.com",0)

Performs a lookup on the TargetURL host www.cisco.com and returns TRUE if the lookup was successful

=NsLookup("www.juniper.net",1)

Performs a lookup on the TargetURL host www.juniper.net and returns the time taken in milliseconds to receive the results from the name server

=NsLookup("CheckTheNetwork.com",,,2,”66.80.130.23”)

Performs a lookup on the TargetURL host CheckTheNetwork.com  The name server at IP address 66.80.130.23 is used to resolve the request. TimeOut is 2 seconds

=NsLookup("https://YouTube.com","AnswerRecordsData" "AAAA")

Performs a lookup on the TargetURL host YouTube.com . Requested return type is all answer records data field for record type AAAA. This will display IPv6 name service information, the IPv6 address(es)
 

Notes

Any argument can be a cell reference like A7 or $D$3

Arguments can be entered as “string” or number value

Default timeout value for DNS resolution is 1 second. The request is tried 1 time

If your request is for a RecordType that is invalid for the TargetURL then an empty string is returned

Return types in the 3x range and other types that contain <fs> display better when the Excel column is formatted with Wrap Text.   Home > Alignment > Wrap Text

<fs>  Field Separator presently equivalent to chr(10), which is also LF, which is also line feed. In an Excel Cell with text formatted as Wrap Text this is equivalent to <altl><enter> which forces the text onto the next line

<fs> Wrap Text formatted cells can also display better with a fixed width font sucha as Lucida Console

Top of Page