Re: Dns.GetHostEntry functionality
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Fri, 14 Mar 2008 09:58:25 -0700
It could be used to resolve your local names, but only if those names are
stored on some local or corporate DNS server. Generally, that's not the
case in an office environment. For example, here, in my office, you can be
100% sure that DNS is not resolving the name of my machine, "FARSIDE". I've
watched the packets...
Paul T.
"David" <david@xxxxxxxxxxx> wrote in message
news:1972FECB-4AC5-47C9-B57F-C3AD926EAADA@xxxxxxxxxxxxxxxx
DNS is absolutely used to resolve computer names. It is also used to
resolve names on the internet too.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:e7g0u9ehIHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
DNS isn't being used to resolve some local name. DNS is what is used to
resolve things like www.microsoft.com. There's no local service that
knows about your PC's NetBIOS name. I'm not 100% sure that NetBIOS names
like that *should* be resolved on WM5 devices. Unfortunately, I also
can't check it right now on mine. Maybe someone else knows...
Paul T.
"David" <david@xxxxxxxxxxx> wrote in message
news:5640D4EC-8A68-4111-98F0-8CE9C665DDBC@xxxxxxxxxxxxxxxx
HP 2790
Windows Mobile 5.0
HP iPAQ Wi-Fi Adapter
I have OpenNetCF installed on the device and I have used it to build
some code to go through the network configuration. It shows that I have
the correct DNS entries.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:uhopxtehIHA.6136@xxxxxxxxxxxxxxxxxxxxxxx
The only thing that I can think of is that the name you're asking for
is wrong (isn't the real device name), or that there's a bug in
resolution for NetBIOS names with - characters in them. What sort of
device are we talking about (it's not Windows Mobile, for example?)?
Version of CE? Networking components built in?
Your code works fine on my device.
Paul T.
"David" <david@xxxxxxxxxxx> wrote in message
news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@xxxxxxxxxxxxxxxx
I have this code:
try
{
IPAddress[] addresses =
Dns.GetHostEntry("david-1").AddressList;
foreach (IPAddress address in addresses)
{
if (address.AddressFamily ==
AddressFamily.InterNetwork)
{
m_strServeIP = address.ToString();
break;
}
}
}
catch (SocketException ex)
{
MessageBox.Show(ex.Message);
Close();
return;
}
A SocketException is thrown "No such host is known".
Yet, I know I have connectivity since I can browse the internet and I
have a valid ip address and it can be pinged from the david-1
computer. My DHCP server is giving out dns and gateway information.
Why does the GetHostEntry fail?
.
- Follow-Ups:
- Re: Dns.GetHostEntry functionality
- From: Simon Hart [MVP]
- Re: Dns.GetHostEntry functionality
- References:
- Re: Dns.GetHostEntry functionality
- From: Paul G. Tobey [eMVP]
- Re: Dns.GetHostEntry functionality
- From: David
- Re: Dns.GetHostEntry functionality
- From: Paul G. Tobey [eMVP]
- Re: Dns.GetHostEntry functionality
- From: David
- Re: Dns.GetHostEntry functionality
- Prev by Date: Re: Dns.GetHostEntry functionality
- Next by Date: Re: Dns.GetHostEntry functionality
- Previous by thread: Re: Dns.GetHostEntry functionality
- Next by thread: Re: Dns.GetHostEntry functionality
- Index(es):
Relevant Pages
|