Re: Dns.GetHostEntry functionality
- From: Simon Hart [MVP] <srhartone@xxxxxxxxx>
- Date: Mon, 17 Mar 2008 02:17:00 -0700
You could use the Win CE emulator.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
"David" wrote:
I dont have a non-WinMo CE device..
"Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> wrote in message
news:uZCtjt6hIHA.6032@xxxxxxxxxxxxxxxxxxxxxxx
I'd try it with a generic, non-WinMo CE device with full networking
components and see if it behaves differently. That would tell you if it's
WinMo specific or a larger problem.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"David" <david@xxxxxxxxxxx> wrote in message
news:92D8B9D5-84CD-416C-A015-C62BC70D43E1@xxxxxxxxxxxxxxxx
I have a Windows Server 2008 machine, non-domain server. It is a DHCP
server as well as a DNS server. All of my computers and devices get their
ip addresses from the 2008 DHCP server. All PCs can resolved names using
the C# code snippet. It is only the device that cannot resolve the name.
The server and computers and devices (via WiFi access point) are all
connected together through switches. None go through a router. The router
is connected to the cable modem to the internet, but the router has DHCP
turned off. The Access points have DHCP turned off as well so there will
be no confict (only one dhcp server allowed on a network).
"Simon Hart [MVP]" <srhartone@xxxxxxxxx> wrote in message
news:88BF106F-5347-4C0E-A5C8-E2420AF1659D@xxxxxxxxxxxxxxxx
That's probebly because you don't have a local DNS server. Generally if
you
don't have a network server you normally will not have a DNS server. For
example my network here has a W2003 Server box with AD configured, I am
able
to resolve machine names via my device the same is true in my office at
work.
If you've got a router and modem with DHCP (most have DHCP now) and your
pc
hangs off that, you will not be able to resolve machine names. You can
resolve internet names because the modem will know the internet DNS
server
but of course this server will not be able to resolve local names.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
"Paul G. Tobey [eMVP]" wrote:
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?
- 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
- From: Paul G. Tobey [eMVP]
- Re: Dns.GetHostEntry functionality
- From: Simon Hart [MVP]
- Re: Dns.GetHostEntry functionality
- From: David
- Re: Dns.GetHostEntry functionality
- From: Chris Tacke, eMVP
- Re: Dns.GetHostEntry functionality
- From: David
- Re: Dns.GetHostEntry functionality
- Prev by Date: Re: Dns.GetHostEntry functionality
- Next by Date: Multiple Concurrent calls to a Web Service
- Previous by thread: Re: Dns.GetHostEntry functionality
- Next by thread: Re: Dns.GetHostEntry functionality
- Index(es):
Relevant Pages
|