HOSTS not working??!?

J

Jessica Loriena

I have a Win2K server with a local IP of 192.168.0.3.

There is a HOSTS file (with no extension) in
\WINNT\system32\drivers\etc with the following content:

127.0.0.1 localhost
192.168.0.3 somehost.somedomain.com

When I ping 192.168.0.3 it responds normally, but when I try ping
somehost.somedomain.com, it returns "Unknown host". There is no DNS
server installed.

Can anyone tell me what may be wrong?
 
A

Ace Fekay [MVP]

In
Jessica Loriena said:
I have a Win2K server with a local IP of 192.168.0.3.

There is a HOSTS file (with no extension) in
\WINNT\system32\drivers\etc with the following content:

127.0.0.1 localhost
192.168.0.3 somehost.somedomain.com

When I ping 192.168.0.3 it responds normally, but when I try ping
somehost.somedomain.com, it returns "Unknown host". There is no DNS
server installed.

Can anyone tell me what may be wrong?


Do you have any services disabled, such as the DNS Client service or the
DHCP Client service?

When you type in a cmd prompt:

ipconfig /showdns

What do you see? Do you see the 192.168.0.3 entry pointing to
somehost.somedomain.com?

--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS-IS" with no warranties and confers no
rights.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory

HAM AND EGGS: A day's work for a chicken; A lifetime commitment for a
pig. --
=================================
 
K

Kevin D. Goodknecht [MVP]

In
Jessica Loriena said:
I have a Win2K server with a local IP of 192.168.0.3.

There is a HOSTS file (with no extension) in
\WINNT\system32\drivers\etc with the following content:

127.0.0.1 localhost
192.168.0.3 somehost.somedomain.com

When I ping 192.168.0.3 it responds normally, but when I try ping
somehost.somedomain.com, it returns "Unknown host". There is no DNS
server installed.

Can anyone tell me what may be wrong?

Do you have DNS installed?
 
J

Jessica Loriena

I don't have a DNS server installed on this server and I'm not using
DHCP. The server has a static IP address of 192.168.0.3. I can ping to
localhost which resolves to 127.0.0.1. It also pings to the IP address
192.168.0.3 normally.

I'll check if DNS / DHCP Client services are enabled, but again, I'm
not using DNS or DHCP. I'll also try "ipconfig /showdns" and I'll get
back to you.

Thanks for your reply.
 
K

Kevin D. Goodknecht [MVP]

In
Jessica Loriena said:
I don't have a DNS server installed.

Why are you using a hosts file instead of DNS?

There are cases when a hosts file is needed but in most cases DNS is much
better easier to manage, and is more difficult to hijack.
 
O

ObiWan

I have a Win2K server with a local IP of 192.168.0.3.
There is a HOSTS file (with no extension) in
\WINNT\system32\drivers\etc with the following content:

127.0.0.1 localhost
192.168.0.3 somehost.somedomain.com

When I ping 192.168.0.3 it responds normally, but when I try ping
somehost.somedomain.com, it returns "Unknown host". There is no DNS
server installed.

Can anyone tell me what may be wrong?

Could you please try to run ping as follows

ping somehost.somedomain.com.

(notice the final DOT) and then post back
the results of such a command ?
 
J

Jessica Loriena

ping somehost.somedomain.com. (with final dot) returns

Unknown host somehost.somedomain.com..

By the way, there is no DNS server installed on this server.
 
J

Jessica Loriena

Both DNs and DHCP Client services are "started", although there is NO
DNS server installed on this computer. Even if there was a DNS server,
shouldn't an entry in WINNT\system32\etc\HOSTS work anyway??

I'm not sure this is relevant, but my TCP/IP config is as follows:

IP address (Static): 192.168.0.3
Subnet Mask: 255.255.255.0
Default Gateway (for internet access): 192.168.0.1 (Internet gateway
server)
Preferred DNS Server (for internet access): 192.168.0.1

As you can see, there is a "preferred DNS Server" pointing to my
internet gateway, but doesn't the HOSTS file precede this DNS setting?
If not, how can I use a HOSTS file without losing internet access??

192.168.0.3 somehost.somedomain.com

I'd greatly appreciate any help.
 
K

Kevin D. Goodknecht [MVP]

In
Jessica Loriena said:
Both DNs and DHCP Client services are "started", although there is NO
DNS server installed on this computer. Even if there was a DNS server,
shouldn't an entry in WINNT\system32\etc\HOSTS work anyway??

I'm not sure this is relevant, but my TCP/IP config is as follows:

IP address (Static): 192.168.0.3
Subnet Mask: 255.255.255.0
Default Gateway (for internet access): 192.168.0.1 (Internet gateway
server)
Preferred DNS Server (for internet access): 192.168.0.1

As you can see, there is a "preferred DNS Server" pointing to my
internet gateway, but doesn't the HOSTS file precede this DNS setting?
If not, how can I use a HOSTS file without losing internet access??

192.168.0.3 somehost.somedomain.com

I'd greatly appreciate any help.

Run ipconfig /displaydns to see if the name is getting loaded in the DNS
resolver cache.
 
A

Ace Fekay [MVP]

In
Jessica Loriena said:
ping somehost.somedomain.com. (with final dot) returns

Unknown host somehost.somedomain.com..

By the way, there is no DNS server installed on this server.


Ok, we understand there is NO DNS server installed. What everyone is asking
is to type in:

ipconfig /displaydns

This should show YOU what you put in the HOSTS file and will tell US whether
your HOSTS file is being read and loaded or not. So far reading thru the
posts, I haven't seen a response on this one. This is somewhat important in
diagnosing this for you Jessica.

Also, make sure that when you save the HOSTS file, that y ou save it with
quotes ("HOSTS") so it will not put a .txt extension on it. If your view
options are set to hide known extension types, then you may not realize that
a .txt is on the end of it, which will render it useless.

Since you're DNS address shows 192.168.0.1, which is your gateway, then may
I assume you are using ICS for Internet sharing?

--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS-IS" with no warranties and confers no
rights.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory

HAM AND EGGS: A day's work for a chicken; A lifetime commitment for a
pig. --
=================================
 
O

ObiWan

Ok, this helps a little, I was wondering if there was some
"domain suffix" set which may interfere with the whole
hostname resolution process, but that doesn't seem
to be the case, now ...

Ok, we understand there is NO DNS server installed. What
everyone is asking is to type in:

ipconfig /displaydns

Correct Ace .. or, better, to type in:

ipconfig /displaydns >c:\dns.txt

and then to post the contents of the
newly created file "c:\dns.txt" so that
we'll be able to see what the HOSTS
file contains

Uh, and since we're at it; fire up a
command prompt, change directory
to c:\winnt\system32\drivers\etc then
enter the command

dir >c:\etc.txt

and post also the contents of the newly
created c:\etc.txt file here, that would help
too in diagnosing your problem
 
A

Ace Fekay [MVP]

In
ObiWan said:
Ok, this helps a little, I was wondering if there was some
"domain suffix" set which may interfere with the whole
hostname resolution process, but that doesn't seem
to be the case, now ...



Correct Ace .. or, better, to type in:

ipconfig /displaydns >c:\dns.txt

and then to post the contents of the
newly created file "c:\dns.txt" so that
we'll be able to see what the HOSTS
file contains

Uh, and since we're at it; fire up a
command prompt, change directory
to c:\winnt\system32\drivers\etc then
enter the command

dir >c:\etc.txt

and post also the contents of the newly
created c:\etc.txt file here, that would help
too in diagnosing your problem


All good points !

Hope we can help Jessica out.

--
Regards,
Ace

Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS-IS" with no warranties and confers no
rights.

Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory

HAM AND EGGS: A day's work for a chicken; A lifetime commitment for a
pig. --
=================================
 

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