I use nslookup on my cmd line and I am then returned my standard server ip address but I can't seem to get this address using vb.net. I did manage to read up on DSN and vb.net but it still made little sense to me could somebody help me get this ip address?
Asked
Active
Viewed 1,203 times
-1
-
1What are you trying to do? Your question is not very clear. – Ňɏssa Pøngjǣrdenlarp Dec 17 '15 at 15:56
-
well I need to get the standard server adress, I get this by typing nslookup into my command prompt, but I want vb.net to get this automatically however I dont know how – LabRat Dec 17 '15 at 16:14
1 Answers
0
Sample code from MSDN website:
The following code example displays the DNS addresses for the network interfaces on the local computer.
Public Shared Sub DisplayDnsAddresses()
Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
Dim adapter As NetworkInterface
For Each adapter In adapters
Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
Dim dnsServers As IPAddressCollection = adapterProperties.DnsAddresses
If dnsServers.Count > 0 Then
Console.WriteLine(adapter.Description)
Dim dns As IPAddress
For Each dns In dnsServers
Console.WriteLine(" DNS Servers ............................. : {0}",dns.ToString() )
Next dns
End If
Next adapter
End Sub 'DisplayDnsAddresses

Matt Wilko
- 26,994
- 10
- 93
- 143