The control's release notes can be found on our web site, looking for the Release Notes column in the control's main page. Click here for direct link.
The ExLookupDN COM object is a DNS (Domain Name Service) component that can be used for network diagnosing, troubleshooting, and monitoring. In order to be able to use the component all that you need to do is to add a reference to the ExLookupNS library to your project.
The Query property of the component retrieves a Message object. When you do a call for any property of the Message object, the components builds and sends the query to the name server. When you do a query using one of the following properties MailInformation, HostInformation, Location, WellKnownService or ZoneOfAuthority, it is recommended to store the object reference for future use ( else a new query is sent to the name server ), like in the following sample:Dim ns As New LookupNS, soa As ZoneOfAuthority Set soa = ns.Query("microsoft.com").ZoneOfAuthority If (ns.LastErrorCode = 0) Then Debug.Print "origin: " & soa.PrimaryNameServer Debug.Print "mail addr: " & soa.MailboxServerName Debug.Print "serial: " + Str(soa.Serial) Debug.Print "refresh: " + Str(soa.Refresh) + "(" & Str(soa.Refresh / 60) & "M)" Debug.Print "retry: " + Str(soa.Retry) + "(" & Str(soa.Retry / 60) & "M)" Debug.Print "expire: " + Str(soa.Expire) + "(" + Str(soa.Expire / 60) & "M)" Debug.Print "minimum ttl: " + Str(soa.Minimum) + "(" + Str(soa.Minimum / 60) & "M)" End If
You have to query the name server using the DomainNamePointer property. Here's the sample:Dim ns As New LookupNS Debug.Print ns.Query("126.96.36.199").DomainNamePointer
The ExLookupNS component is able to ask the name server for all mail servers for a host.
The ExLookupNS components has implemented the LOC DNS record resource as described by RFC 1876. The following sample shows how to get the location for yahoo.com:Dim ns As New LookupNS Dim loc As Location Set loc = ns.Query("yahoo.com").Location Debug.Print "Version:" & loc.Version Debug.Print "Size:" & Str(loc.Size) & " cm." Debug.Print "Latitude:" & loc.Latitude Debug.Print "Longitude:" & loc.Longitude Debug.Print "Altitude:" & loc.Altitude
The idea is to check the LastErrorCode property. See bellow for all error codes.Dim ns As New LookupNS, s As String s = ns.Query("micro4soft.com").Address If (ns.LastErrorCode = 32003) Then Debug.Print "The host does not exist." End If
Everything is fine, but all that I've got is an empty string? Is there any way to know what's happening?
The ExLookupNS implements LastError(LastErrorCode) property that gets the description(code) for the last error. So, it is recommended to check the LastError property after a query was sent to the server as bellow sample. The ExLookupNS component handles two kind of errors: WSA ( sockets error ) and NS ( name server ) errors. An WSA error occurs only if the component fails to comunicate with the name server. A NS error occurs only if the name server was unable to answer to the query.
By default, the Server property of the component is set to the first local name server found. To change the timeout value use the TimeOut property. If you need an infinite timeout use -1.