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?

Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 10:52:45 CDT 2008

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@simmonds.ca> wrote in message
news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>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?



Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:16:14 CDT 2008

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@TK2MSFTNGP03.phx.gbl...
> 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@simmonds.ca> wrote in message
> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>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?
>
>
>


Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:17:14 CDT 2008

david-1 is a PC running Windows Vista.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
> 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@simmonds.ca> wrote in message
> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>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?
>
>
>


Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 11:21:19 CDT 2008

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@simmonds.ca> wrote in message
news:5640D4EC-8A68-4111-98F0-8CE9C665DDBC@microsoft.com...
> 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@TK2MSFTNGP03.phx.gbl...
>> 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@simmonds.ca> wrote in message
>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>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?
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:23:13 CDT 2008

If I substitute 10.0.0.20 for david-1, everything works fine. That is, the
functionality of my app works to connect to the PC and retrieve data and
send data. So this tells me that I have connectivity to the network. It is
just that DNS seems not work work. Does Vista not use netbios names? I am
pretty sure that it does.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
> 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@simmonds.ca> wrote in message
> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>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?
>
>
>


Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 11:26:13 CDT 2008

Hmmm. Well, I can't test that. Is the NetBIOS protocol enabled for the
network adapter that 'faces' your WM5 device?

Paul T.

"David" <david@simmonds.ca> wrote in message
news:066073B8-06C1-4E08-970A-77562A5870C7@microsoft.com...
> david-1 is a PC running Windows Vista.
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>> 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@simmonds.ca> wrote in message
>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>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?
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:27:19 CDT 2008

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@TK2MSFTNGP02.phx.gbl...
> 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@simmonds.ca> wrote in message
> news:5640D4EC-8A68-4111-98F0-8CE9C665DDBC@microsoft.com...
>> 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@TK2MSFTNGP03.phx.gbl...
>>> 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@simmonds.ca> wrote in message
>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>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?
>>>
>>>
>>>
>>
>
>
>


Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:31:02 CDT 2008

Where do I check that?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:OFodeAfhIHA.1168@TK2MSFTNGP02.phx.gbl...
> Hmmm. Well, I can't test that. Is the NetBIOS protocol enabled for the
> network adapter that 'faces' your WM5 device?
>
> Paul T.
>
> "David" <david@simmonds.ca> wrote in message
> news:066073B8-06C1-4E08-970A-77562A5870C7@microsoft.com...
>> david-1 is a PC running Windows Vista.
>>
>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>> 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@simmonds.ca> wrote in message
>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>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?
>>>
>>>
>>>
>>
>
>
>


Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 11:42:04 CDT 2008

If you mean, is NetBIOS enabled on my Vista computer, then yes, it is
enabled.

"David" <david@simmonds.ca> wrote in message
news:%239dLODfhIHA.4320@TK2MSFTNGP06.phx.gbl...
> Where do I check that?
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:OFodeAfhIHA.1168@TK2MSFTNGP02.phx.gbl...
>> Hmmm. Well, I can't test that. Is the NetBIOS protocol enabled for the
>> network adapter that 'faces' your WM5 device?
>>
>> Paul T.
>>
>> "David" <david@simmonds.ca> wrote in message
>> news:066073B8-06C1-4E08-970A-77562A5870C7@microsoft.com...
>>> david-1 is a PC running Windows Vista.
>>>
>>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>>> 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@simmonds.ca> wrote in message
>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>


Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 11:59:22 CDT 2008

I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure that
will work.

Paul T.

"David" <david@simmonds.ca> wrote in message
news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
> If I substitute 10.0.0.20 for david-1, everything works fine. That is, the
> functionality of my app works to connect to the PC and retrieve data and
> send data. So this tells me that I have connectivity to the network. It is
> just that DNS seems not work work. Does Vista not use netbios names? I am
> pretty sure that it does.
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>> 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@simmonds.ca> wrote in message
>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>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?
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 11:58:25 CDT 2008

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@simmonds.ca> wrote in message
news:1972FECB-4AC5-47C9-B57F-C3AD926EAADA@microsoft.com...
> 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@TK2MSFTNGP02.phx.gbl...
>> 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@simmonds.ca> wrote in message
>> news:5640D4EC-8A68-4111-98F0-8CE9C665DDBC@microsoft.com...
>>> 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@TK2MSFTNGP03.phx.gbl...
>>>> 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@simmonds.ca> wrote in message
>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 12:13:40 CDT 2008

Ok, I can buy into that. However, I work from home and my network resolves
the name requests through my Windows Server 2008 system.

Just curious, in a network like your office network, where do the names get
resolved?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
> that will work.
>
> Paul T.
>
> "David" <david@simmonds.ca> wrote in message
> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>> the functionality of my app works to connect to the PC and retrieve data
>> and send data. So this tells me that I have connectivity to the network.
>> It is just that DNS seems not work work. Does Vista not use netbios
>> names? I am pretty sure that it does.
>>
>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>> 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@simmonds.ca> wrote in message
>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>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?
>>>
>>>
>>>
>>
>
>
>


Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 12:15:42 CDT 2008

You are correct. www.microsoft.conm resolved fine. Now I really need to know
how to resolve a computer name. I hope that someone can answer this.


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
> that will work.
>
> Paul T.
>
> "David" <david@simmonds.ca> wrote in message
> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>> the functionality of my app works to connect to the PC and retrieve data
>> and send data. So this tells me that I have connectivity to the network.
>> It is just that DNS seems not work work. Does Vista not use netbios
>> names? I am pretty sure that it does.
>>
>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>> 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@simmonds.ca> wrote in message
>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>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?
>>>
>>>
>>>
>>
>
>
>


Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 12:24:29 CDT 2008

NetBIOS names are resolved via NetBIOS name registration. Internet names
are resolved via DNS. Dns.GetHostEntry does *NOT* imply that DNS is
*actually* being used, any more than the native WinSock call gethostbyname()
does. "Dns" was a poor choice of class names...

Paul T.

"David" <david@simmonds.ca> wrote in message
news:2DBE257D-43ED-4C30-9823-4C5A2BDC0296@microsoft.com...
> Ok, I can buy into that. However, I work from home and my network resolves
> the name requests through my Windows Server 2008 system.
>
> Just curious, in a network like your office network, where do the names
> get resolved?
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
>> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
>> that will work.
>>
>> Paul T.
>>
>> "David" <david@simmonds.ca> wrote in message
>> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>>> the functionality of my app works to connect to the PC and retrieve data
>>> and send data. So this tells me that I have connectivity to the network.
>>> It is just that DNS seems not work work. Does Vista not use netbios
>>> names? I am pretty sure that it does.
>>>
>>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>>> 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@simmonds.ca> wrote in message
>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by Chris

Chris
Fri Mar 14 12:25:22 CDT 2008

Is the machine you're trying to resolve in a domain? If so you might try
with a domain suffix (i.e. david1.mydomain.net) to see if the PDC (or
whatever internal DNS server you're using) will resolve it for you. I'm
pretty sure that Paul is correct that it's something to do with the NetBIOS
name not being DNS resolvable, though I'm not sure if it's VIsta related or
not (I try to avoid Vista). You might also try a local XP machine too to
see if there is a behavioral difference.

I'd also consider it worthwhile to do a test from desktop-to-desktop machine
to see if the same code resolves for them in the same network.

--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com



"David" <david@simmonds.ca> wrote in message
news:01C7F6B3-14A7-446D-9DE2-0C52FF5612DD@microsoft.com...
> You are correct. www.microsoft.conm resolved fine. Now I really need to
> know how to resolve a computer name. I hope that someone can answer this.
>
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
>> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
>> that will work.
>>
>> Paul T.
>>
>> "David" <david@simmonds.ca> wrote in message
>> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>>> the functionality of my app works to connect to the PC and retrieve data
>>> and send data. So this tells me that I have connectivity to the network.
>>> It is just that DNS seems not work work. Does Vista not use netbios
>>> names? I am pretty sure that it does.
>>>
>>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>>> 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@simmonds.ca> wrote in message
>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by Paul

Paul
Fri Mar 14 12:29:05 CDT 2008

OK, you have a single PC at home? The Windows Server system? Or that
machine is remote? If you have two PC-type machines, open a MS-DOS window
on one of them and try to view the network information for the one whose
name you're currently trying to resolve, using the machine name. For
example,

net view \\david-1

If this works, that indicates to me that you have name resolution. That
would point to a possible problem with the resolution capabilities on the
device. If it does not work, that points to your name resolution system (PC
problem).

If the former is the case and the device is indicated as the problem source,
try renaming the machine whose name you are trying to resolve from "david-1"
to something without that nasty - character like "david1". Does that work?

Paul T.

"David" <david@simmonds.ca> wrote in message
news:01C7F6B3-14A7-446D-9DE2-0C52FF5612DD@microsoft.com...
> You are correct. www.microsoft.conm resolved fine. Now I really need to
> know how to resolve a computer name. I hope that someone can answer this.
>
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
>> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
>> that will work.
>>
>> Paul T.
>>
>> "David" <david@simmonds.ca> wrote in message
>> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>>> the functionality of my app works to connect to the PC and retrieve data
>>> and send data. So this tells me that I have connectivity to the network.
>>> It is just that DNS seems not work work. Does Vista not use netbios
>>> names? I am pretty sure that it does.
>>>
>>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>>> 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@simmonds.ca> wrote in message
>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>



Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 12:31:46 CDT 2008

Yes, the same code works on my Vista laptop (david-2). I correctly get the
ip address of the david-1 computer.

"Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> wrote in message
news:u$m0nhfhIHA.4436@TK2MSFTNGP02.phx.gbl...
> Is the machine you're trying to resolve in a domain? If so you might try
> with a domain suffix (i.e. david1.mydomain.net) to see if the PDC (or
> whatever internal DNS server you're using) will resolve it for you. I'm
> pretty sure that Paul is correct that it's something to do with the
> NetBIOS name not being DNS resolvable, though I'm not sure if it's VIsta
> related or not (I try to avoid Vista). You might also try a local XP
> machine too to see if there is a behavioral difference.
>
> I'd also consider it worthwhile to do a test from desktop-to-desktop
> machine to see if the same code resolves for them in the same network.
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Giving back to the embedded community
> http://community.OpenNETCF.com
>
>
>
> "David" <david@simmonds.ca> wrote in message
> news:01C7F6B3-14A7-446D-9DE2-0C52FF5612DD@microsoft.com...
>> You are correct. www.microsoft.conm resolved fine. Now I really need to
>> know how to resolve a computer name. I hope that someone can answer this.
>>
>>
>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>> DOT com> wrote in message news:Of25$SfhIHA.200@TK2MSFTNGP02.phx.gbl...
>>> I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty sure
>>> that will work.
>>>
>>> Paul T.
>>>
>>> "David" <david@simmonds.ca> wrote in message
>>> news:1E71F8D9-2C94-4BC8-87B5-C736DD25FEBF@microsoft.com...
>>>> If I substitute 10.0.0.20 for david-1, everything works fine. That is,
>>>> the functionality of my app works to connect to the PC and retrieve
>>>> data and send data. So this tells me that I have connectivity to the
>>>> network. It is just that DNS seems not work work. Does Vista not use
>>>> netbios names? I am pretty sure that it does.
>>>>
>>>> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
>>>> DOT com> wrote in message news:uhopxtehIHA.6136@TK2MSFTNGP03.phx.gbl...
>>>>> 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@simmonds.ca> wrote in message
>>>>> news:B3DAB770-2D94-4BE6-8899-B0C51B61F484@microsoft.com...
>>>>>>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?
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>
>
>


Re: Dns.GetHostEntry functionality by David

David
Fri Mar 14 12:33:57 CDT 2008

I have many computers, one of which is the server.

I just tried new view \\david-1 on my david-2 vista laptop. It came back
with "There are no entries in the list."

The Dns.GetHostEntry("david-1") code works fine on the laptop though. It
returns the correct ip address of david-1.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:eN38mjfhIHA.1184@TK2MSFTNGP04.phx.gbl...
> OK, you have a single PC at home? The Windows Server system? Or that
> machine is remote? If you have two PC-type machines, open a MS-DOS window
> on one of them and try to view the network information for the one whose
> name you're currently trying to resolve, using the machine name. For
>