Re: System.Net.Dns????

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



ok, now what about passing an ip address?
MsgBox(GetHostEntry(Me.txtLookupHostIP.Text).HostName)

me.txtLookupHostIP.text = 192.168.1.1 This address is assigned from a dhcp
server on the local network....

and is listed in the dns.. and I get "No such host is known"



"kimiraikkonen" <kimiraikkonen85@xxxxxxxxx> wrote in message
news:093dc17a-4135-4a38-8ef9-2e40503bee1e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 13, 6:05 am, "Brian" <bsgalla...@xxxxxxxxxxxxxxxx> wrote:


I am just trying to pass an IP address and get the Host name... either
from
the internet or local network.. or pass the host name and get the ip..

Using VB 2005, i can get hostname simply by using:
System.Net.Dns.GetHostName.ToString

And getting IP address by passing hostname can be done using:
'-----------------------------------
Imports System.Net.Dns
Imports System.Net

Dim hostname As String
hostname = GetHostName.ToString
For Each ip As IPAddress In _
GetHostEntry(hostname).AddressList
' Return IP address in messagebox
MsgBox(ip.ToString)
Next
'------------------------------

Hope this helps,

Onur Güzel


.



Relevant Pages

  • Re: General DNS config questions
    ... 0-9 and - are allowed as characters in DNS... ... host name that GoDaddy didn't like. ... No, no - you're right, it should be a hostname. ... Better to be safe. ...
    (microsoft.public.windows.server.dns)
  • Re: hostnames and interfaces
    ... > interface) and routers (multiple interfaces) can one define multiple ... > host names and IP addresses (strickly speaking that is what dns etc sees?) ... this can be a problem with a multi-homed host: ... Any machine will have a hostname -- that is the name which gets ...
    (freebsd-questions)
  • Re: can access IPs but not by hostname
    ... I know you said nslookup shows DNS is fine but, can you you ping a host name ... Using any browser by hostname fails with server can't be found. ...
    (microsoft.public.windows.server.general)
  • Re: exim HELO=fully qualified host name?
    ... > Basically correct. ... > You can test the system's idea of your host name either by running the ... (since one can't generally resolve the loopback address via DNS). ... suppose its less expensive than a DNS query, but specifying a hostname ...
    (Debian-User)
  • Re: System.Net.Dns????
    ... the internet or local network.. ... or pass the host name and get the ip.. ... And getting IP address by passing hostname can be done using: ...
    (microsoft.public.dotnet.languages.vb)