Dns.GetHostEntry functionality

P

Paul G. Tobey [eMVP]

I wanted to verify name resolution of the david-1 name. Sounds like it's
either working fine or, as Chris mentioned, there's a domain involved.
Windows CE does not know about, participate in, or resolve anything with
domains. Try the "mainserver" name (that's perfect: no numbers and no minus
signs in the name), on the device. Let us know what you find.

Paul T.

David said:
The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it does
have shares.

David said:
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:[email protected]...
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.

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 I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
D

David

I maually put in a DNS entry into the device network settings, even though
OpenNetCF apis are reporting dns addresses. Now I get one IP address in the
list returned by GetHostEntry, both for david-1 and for mainserver. The IP
address comes back as an IPv6 address though which is not usable. Now what?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
I wanted to verify name resolution of the david-1 name. Sounds like it's
either working fine or, as Chris mentioned, there's a domain involved.
Windows CE does not know about, participate in, or resolve anything with
domains. Try the "mainserver" name (that's perfect: no numbers and no
minus signs in the name), on the device. Let us know what you find.

Paul T.

David said:
The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it does
have shares.

David said:
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 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.

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 I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
D

David

No domain is involved. david-1 is not a member of a domain. mainserver is
not a domain server either.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
I wanted to verify name resolution of the david-1 name. Sounds like it's
either working fine or, as Chris mentioned, there's a domain involved.
Windows CE does not know about, participate in, or resolve anything with
domains. Try the "mainserver" name (that's perfect: no numbers and no
minus signs in the name), on the device. Let us know what you find.

Paul T.

David said:
The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it does
have shares.

David said:
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 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.

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 I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
P

Paul G. Tobey [eMVP]

Step back and try mainserver only, with no random manual changes to the
network configuration.

Paul T.

David said:
I maually put in a DNS entry into the device network settings, even though
OpenNetCF apis are reporting dns addresses. Now I get one IP address in the
list returned by GetHostEntry, both for david-1 and for mainserver. The IP
address comes back as an IPv6 address though which is not usable. Now what?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
I wanted to verify name resolution of the david-1 name. Sounds like it's
either working fine or, as Chris mentioned, there's a domain involved.
Windows CE does not know about, participate in, or resolve anything with
domains. Try the "mainserver" name (that's perfect: no numbers and no
minus signs in the name), on the device. Let us know what you find.

Paul T.

David said:
The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it does
have shares.

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 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.

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
I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
D

David

Using mainserver has the same issues.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
Step back and try mainserver only, with no random manual changes to the
network configuration.

Paul T.

David said:
I maually put in a DNS entry into the device network settings, even though
OpenNetCF apis are reporting dns addresses. Now I get one IP address in
the list returned by GetHostEntry, both for david-1 and for mainserver.
The IP address comes back as an IPv6 address though which is not usable.
Now what?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:[email protected]...
I wanted to verify name resolution of the david-1 name. Sounds like it's
either working fine or, as Chris mentioned, there's a domain involved.
Windows CE does not know about, participate in, or resolve anything with
domains. Try the "mainserver" name (that's perfect: no numbers and no
minus signs in the name), on the device. Let us know what you find.

Paul T.

The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it
does have shares.

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
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.

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
I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
P

Paul G. Tobey [eMVP]

OK, I got my WM5 device to try. I get the same thing so, as thought, the
device is the one having the problem and it appears not to be a problem with
Windows CE itself, but the component set chosen to base Windows Mobile 5
upon, or perhaps some settings that prevent this from working. I can't
think of anything else to try, other than searching for information on
Windows Mobile name resolution to see if there is a setting.

Paul T.

David said:
Using mainserver has the same issues.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
Step back and try mainserver only, with no random manual changes to the
network configuration.

Paul T.

David said:
I maually put in a DNS entry into the device network settings, even
though OpenNetCF apis are reporting dns addresses. Now I get one IP
address in the list returned by GetHostEntry, both for david-1 and for
mainserver. The IP address comes back as an IPv6 address though which is
not usable. Now what?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message I wanted to verify name resolution of the david-1 name. Sounds like
it's either working fine or, as Chris mentioned, there's a domain
involved. Windows CE does not know about, participate in, or resolve
anything with domains. Try the "mainserver" name (that's perfect: no
numbers and no minus signs in the name), on the device. Let us know
what you find.

Paul T.

The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it
does have shares.

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
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.

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
I'm no Vista expert. Try resolving www.microsoft.com. I'm pretty
sure that will work.

Paul T.

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
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.

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?
 
P

Paul G. Tobey [eMVP]

Well, I did think of one thing: setting one of the WINS addresses to the IP
of a PC-type host that would 'know' the names of any device on the local
network. Since this is a bit of a pain, you probably want to see if you can
find a way to make it work without this, but...

Paul T.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
OK, I got my WM5 device to try. I get the same thing so, as thought, the
device is the one having the problem and it appears not to be a problem
with Windows CE itself, but the component set chosen to base Windows
Mobile 5 upon, or perhaps some settings that prevent this from working. I
can't think of anything else to try, other than searching for information
on Windows Mobile name resolution to see if there is a setting.

Paul T.

David said:
Using mainserver has the same issues.

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:[email protected]...
Step back and try mainserver only, with no random manual changes to the
network configuration.

Paul T.

I maually put in a DNS entry into the device network settings, even
though OpenNetCF apis are reporting dns addresses. Now I get one IP
address in the list returned by GetHostEntry, both for david-1 and for
mainserver. The IP address comes back as an IPv6 address though which is
not usable. Now what?

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message I wanted to verify name resolution of the david-1 name. Sounds like
it's either working fine or, as Chris mentioned, there's a domain
involved. Windows CE does not know about, participate in, or resolve
anything with domains. Try the "mainserver" name (that's perfect: no
numbers and no minus signs in the name), on the device. Let us know
what you find.

Paul T.

The net view \\david-1 shows the no entries because I do not have any
shares on david-1.

net view \\mainserver (the server) comes back with results since it
does have shares.

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
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.

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
I'm no Vista expert. Try resolving www.microsoft.com. I'm
pretty sure that will work.

Paul T.

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
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.

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?
 
S

Simon Hart [MVP]

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 said:
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 said:
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:[email protected]...
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.

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 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.

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?
 
D

David

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 said:
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 said:
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 said:
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 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.

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
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.

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?
 
C

Chris Tacke, eMVP

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 said:
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 said:
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 said:
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.

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 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.

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
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.

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?
 
D

David

I dont have a non-WinMo CE device.

Chris Tacke said:
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 said:
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 said:
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


:

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.

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 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.

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
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.

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?
 
S

Simon Hart [MVP]

You could use the Win CE emulator.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


David said:
I dont have a non-WinMo CE device.

Chris Tacke said:
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 said:
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).

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


:

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.

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 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.

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
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.

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?
 
P

Paul G. Tobey [eMVP]

I think that this is just a Windows Mobile problem. Obviously, I'm not
running a local DNS server, but I have no problems resolving machine names
with Windows CE 5-based devices, but my WM5 device won't resolve the same
names. I suppose that you might check in
microsoft.public.pocketpc.developer and see if someone there might have run
into this sooner than I would have and might have a solution or some type of
work-around.

Paul T.

David said:
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 said:
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 said:
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.

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 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.

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
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.

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top