Forum Search:
Forum.Brain-Cluster.com: Brain Cluster Technical Forum
Ultimate forum for Technical Discussions

Home » Microsoft » Windows Server » DNS Server » Server 2003 not reading hosts file
Server 2003 not reading hosts file [message #158612] Thu, 02 July 2009 14:32 Go to next message
geekyguy  is currently offline geekyguy  United States
Messages: 25
Registered: July 2009
Junior Member
Hi All: I've been googling around and have seen a lot of instances of this
issue, but I haven't seen an explanation or resolution.

I have a server2003 web edition sp2, which is part of a 2003 domain on a
private LAN, with a local 2003 DC set as the preferred DNS server.

I have a firewall with 1-1 NAT for each server on the LAN, and if the DC is
queried for the FQDN of a particular server on the LAN, it returns the
public IP address.

That's fine unless I want to resolve the FQDN to a local subnet IP, so to
override DNS resolution I added an entry in the hosts file, like:

192.168.1.12 myserver.domain.com <--the FQDN I want to resolve to the local
IP

I modified the file in Notepad, saved it, and when I ran ipconfig
/displaydns, the contents of the hosts file was displayed (with my entry).

When I ping the hostname it resolves to the IP in the hosts file...all good.

If I nslookup the hostname, however, it queries the DC and gets the public
IP of the server, and obviously if I try to browse to that hostname from the
server it doesn't work.

What do I need to do to get the server to use the hosts entry instead of the
DNS response from the DC?
Re: Server 2003 not reading hosts file [message #158613 is a reply to message #158612] Thu, 02 July 2009 16:47 Go to previous messageGo to next message
aceman  is currently offline aceman  United States
Messages: 5816
Registered: July 2009
Senior Member
"geekyguy" <geeky@guy.com> wrote in message news:uX2JcT0%23JHA.5040@TK2MSFTNGP04.phx.gbl...
> Hi All: I've been googling around and have seen a lot of instances of this
> issue, but I haven't seen an explanation or resolution.
>
> I have a server2003 web edition sp2, which is part of a 2003 domain on a
> private LAN, with a local 2003 DC set as the preferred DNS server.
>
> I have a firewall with 1-1 NAT for each server on the LAN, and if the DC is
> queried for the FQDN of a particular server on the LAN, it returns the
> public IP address.
>
> That's fine unless I want to resolve the FQDN to a local subnet IP, so to
> override DNS resolution I added an entry in the hosts file, like:
>
> 192.168.1.12 myserver.domain.com <--the FQDN I want to resolve to the local
> IP
>
> I modified the file in Notepad, saved it, and when I ran ipconfig
> /displaydns, the contents of the hosts file was displayed (with my entry).
>
> When I ping the hostname it resolves to the IP in the hosts file...all good.
>
> If I nslookup the hostname, however, it queries the DC and gets the public
> IP of the server, and obviously if I try to browse to that hostname from the
> server it doesn't work.
>
> What do I need to do to get the server to use the hosts entry instead of the
> DNS response from the DC?
>


When querying records with nslookup, it simply uses the DNS server in IP properties and will not use the hosts file. Nslookup has it's own resolver independent of the operating system. However, ping uses the system's resolver service, hence why it works with pinging.

My recommendation is, and which is common practice by many, to forget the hosts file, and simply create the external zone name in your own internal DNS server, create a www record, and simply provide the internal IP. This way everyone can get to it internally. Also create the blank host entry (leave the hostname blank) and provide the same IP so you can get to it using http://domain.com without the www.

You will also need to create other records as necessary for the external name, such as ftp, or whatever else is being used.

Host files are an administrative overhead.

--
Ace

This posting is provided "AS-IS" with no warranties or guarantees and confers no rights.

Please reply back to the newsgroup/forum to benefit from collaboration among responding engineers, as well as to help others benefit from your resolution.

Ace Fekay, MCSE 2003 & 2000, MCSA 2003 & 2000, MCSA Messaging, MCT
Microsoft Certified Trainer
aceman@mvps.RemoveThisPart.org
http://twitter.com/acefekay

For urgent issues, you may want to contact Microsoft PSS directly. Please check http://support.microsoft.com for regional support phone numbers.
Re: Server 2003 not reading hosts file [message #158615 is a reply to message #158612] Thu, 02 July 2009 19:35 Go to previous messageGo to next message
Grant Taylor  is currently offline Grant Taylor  United States
Messages: 168
Registered: July 2009
Senior Member
On 7/2/2009 1:32 PM, geekyguy wrote:
> What do I need to do to get the server to use the hosts entry instead of
> the DNS response from the DC?

I believe the server /is/ using the hosts file.

Are you closing and re-opening your browser after you edit your hosts
file? (Some clients cache the information returned to them by the
operating system.)

Are you running "ipconfig /flushdns" after editing your hosts file and
before you try to (re)visit the site? (Make sure the operating system
is not returning its own cached content to clients.)



Grant. . . .
RE: Server 2003 not reading hosts file [message #158776 is a reply to message #158612] Thu, 16 July 2009 12:41 Go to previous messageGo to next message
Michael - Boston  is currently offline Michael - Boston
Messages: 1
Registered: July 2009
Junior Member
I understand what your trying to say exactly.
Host files are only an administrative overhead if used on the clients. If
you could use them on the server and have MS implamentation of DNS consult
the Host file before going to it's forwarders or the hint servers it would
cut your overhead by being able to edit a host file in notepad and not having
to creat all those zone entries, also it would keep the dns server less
cluttered because only the inportant zones will show up.

Sorry I don't have a fix but I see the delema, I have an inpressive host
list myself to keep maliciouse sites away but it sure would be nice to drop
it on just one or two servers and have everyone be able to take advantage of
it. I hope Microsoft considers addressing this.

"geekyguy" wrote:

> Hi All: I've been googling around and have seen a lot of instances of this
> issue, but I haven't seen an explanation or resolution.
>
> I have a server2003 web edition sp2, which is part of a 2003 domain on a
> private LAN, with a local 2003 DC set as the preferred DNS server.
>
> I have a firewall with 1-1 NAT for each server on the LAN, and if the DC is
> queried for the FQDN of a particular server on the LAN, it returns the
> public IP address.
>
> That's fine unless I want to resolve the FQDN to a local subnet IP, so to
> override DNS resolution I added an entry in the hosts file, like:
>
> 192.168.1.12 myserver.domain.com <--the FQDN I want to resolve to the local
> IP
>
> I modified the file in Notepad, saved it, and when I ran ipconfig
> /displaydns, the contents of the hosts file was displayed (with my entry).
>
> When I ping the hostname it resolves to the IP in the hosts file...all good.
>
> If I nslookup the hostname, however, it queries the DC and gets the public
> IP of the server, and obviously if I try to browse to that hostname from the
> server it doesn't work.
>
> What do I need to do to get the server to use the hosts entry instead of the
> DNS response from the DC?
>
>
Re: Server 2003 not reading hosts file [message #158780 is a reply to message #158776] Thu, 16 July 2009 15:40 Go to previous message
aceman  is currently offline aceman  United States
Messages: 5816
Registered: July 2009
Senior Member
"Michael - Boston" <Michael - Boston@discussions.microsoft.com> wrote in
message news:1F13A200-3FC8-41CB-9C71-A4AB18A50930@microsoft.com...
>I understand what your trying to say exactly.
> Host files are only an administrative overhead if used on the clients. If
> you could use them on the server and have MS implamentation of DNS consult
> the Host file before going to it's forwarders or the hint servers it would
> cut your overhead by being able to edit a host file in notepad and not
> having
> to creat all those zone entries, also it would keep the dns server less
> cluttered because only the inportant zones will show up.
>
> Sorry I don't have a fix but I see the delema, I have an inpressive host
> list myself to keep maliciouse sites away but it sure would be nice to
> drop
> it on just one or two servers and have everyone be able to take advantage
> of
> it. I hope Microsoft considers addressing this.

You would need to create a script using DNSCMD to create zones for all the
entries in your hosts file list to put them into DNS. Otherwise, there is no
way to populate the DNS server cache, which is different than the DNS
server's local cache, which only it's own local client side resolver will
use, and will not be used for client queries to the DNS service.

Ace
Goto Forum:
  


Current Time: Thu Sep 21 08:11:19 EDT 2017

Total time taken to generate the page: 0.04799 seconds
.:: Contact :: Home ::Sitemap::.

Powered by: FUDforum 3.0.0RC2.
Copyright ©2001-2009 FUDforum Bulletin Board Software