Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LMHOSTS?

Status
Not open for further replies.

as896

Technical User
Mar 30, 2006
15
0
0
GB
I was trying to solve trust relations between two separate located DC, I can see each on the Entire networks but can not access the resources, it says "access denied", I find out that I need to set the trust relationship between these two DC, But before that I tried to ping each end by both ip address and server name, one side can get reply but other can not. I added the other DC ip address "in local connections alternate DNS server. Still can not ping the other server name. Then I thought it may be I should add the LMHOST file "IP address and servername, but unfortunately I did not know how. Can some help me with LMhosts file to add the servername/ip. Clearly this is DNS issues, is there anyother way of doing this.

thanks very much for your help.
 
Sure, it's nice and easy once you know where it is.

%WINDIR%\System32\Drivers\etc

The syntax is detailed in both 'hosts' and 'lmhosts', just open them in notepad.


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
I found it, but still looks bit hard, I am thinking if amend details, it may affect the server performance. So if you don't mind would please give detailed instructions of how to use it.
 
Go to the bottom of the document, on a blank link add:

192.168.0.45 ServerName

Obviously you will want to replace the IP address and server name with those of your actual server.


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
If you can't ping the server by either name or IP address then this is not a DNS issue and editing the Hosts file won't help.

How are the two servers connected? VPN? Leased Line?



Windows and NT Admin.
 
Thanks very much for your help, I have tried to edit the lmhost file using notepad, from your instruction I used at the bottom of the page and added the ip address + servername
Now bellow the lmhost, see if you can spot errors i made. So far it does not work for me.



# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample LMHOSTS file used by the Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to computernames
# (NetBIOS) names. Each entry should be kept on an individual line.
# The IP address should be placed in the first column followed by the
# corresponding computername. The address and the computername
# should be separated by at least one space or tab. The "#" character
# is generally used to denote the start of a comment (see the exceptions
# below).
#
# This file is compatible with Microsoft LAN Manager 2.x TCP/IP lmhosts
# files and offers the following extensions:
#
# #PRE
# #DOM:<domain>
# #INCLUDE <filename>
# #BEGIN_ALTERNATE
# #END_ALTERNATE
# \0xnn (non-printing character support)
#
# Following any entry in the file with the characters "#PRE" will cause
# the entry to be preloaded into the name cache. By default, entries are
# not preloaded, but are parsed only after dynamic name resolution fails.
#
# Following an entry with the "#DOM:<domain>" tag will associate the
# entry with the domain specified by <domain>. This affects how the
# browser and logon services behave in TCP/IP environments. To preload
# the host name associated with #DOM entry, it is necessary to also add a
# #PRE to the line. The <domain> is always preloaded although it will not
# be shown when the name cache is viewed.
#
# Specifying "#INCLUDE <filename>" will force the RFC NetBIOS (NBT)
# software to seek the specified <filename> and parse it as if it were
# local. <filename> is generally a UNC-based name, allowing a
# centralized lmhosts file to be maintained on a server.
# It is ALWAYS necessary to provide a mapping for the IP address of the
# server prior to the #INCLUDE. This mapping must use the #PRE directive.
# In addtion the share "public" in the example below must be in the
# LanManServer list of "NullSessionShares" in order for client machines to
# be able to read the lmhosts file successfully. This key is under
# \machine\system\currentcontrolset\services\lanmanserver\parameters\nullsessionshares
# in the registry. Simply add "public" to the list found there.
#
# The #BEGIN_ and #END_ALTERNATE keywords allow multiple #INCLUDE
# statements to be grouped together. Any single successful include
# will cause the group to succeed.
#
# Finally, non-printing characters can be embedded in mappings by
# first surrounding the NetBIOS name in quotations, then using the
# \0xnn notation to specify a hex value for a non-printing character.
#
# The following example illustrates all of these extensions:
#
# 102.54.94.97 rhino #PRE #DOM:networking #net group's DC
# 102.54.94.102 "appname \0x14" #special app server
# 102.54.94.123 popular #PRE #source server
# 102.54.94.117 localsrv #PRE #needed for the include
#
# #BEGIN_ALTERNATE
# #INCLUDE \\localsrv\public\lmhosts
# #INCLUDE \\rhino\public\lmhosts
# #END_ALTERNATE
#
# In the above example, the "appname" server contains a special
# character in its name, the "popular" and "localsrv" server names are
# preloaded, and the "rhino" server name is specified so it can be used
# to later #INCLUDE a centrally maintained lmhosts file if the "localsrv"
# system is unavailable.
#
# Note that the whole file is parsed including comments on each lookup,
# so keeping the number of comments to a minimum will improve performance.
# Therefore it is not advisable to simply add lmhosts file entries onto the
# end of this file.



10.120.175.2 2kserverBHAM

 
The two DC are connected via VPN. If it not the DNS issue then what is it.

Thanks for your help.
 
Ah, sorry. Scott is quite right, I completely missed the section where you tried to ping via IP address. For the record your lmhosts modification is corrent.

If you cannot ping by IP address and you are connected over a VPN then the problem is most likely routing-based.


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
Grenage: I can ping the by using ip address but not by name that is why I am editing lmhost file. The vnp is fine, router is fine.

 
Ok, does it make any difference if you put an identical entry in the 'hosts' file, too? It's in the same folder as lmhosts.


Carlsberg don't run I.T departments, but if they did they'd probably be more fun.
 
Thanks Grenage, this helped and sorted the problem, when I added ip address and sername to LMHOST as well as Hosts. It is now pinging both ip address and servername as well.

Thanks to you again.
 
hi as896,
just a side note:
# Note that the whole file is parsed including comments on each lookup,
# so keeping the number of comments to a minimum will improve performance.
# Therefore it is not advisable to simply add lmhosts file entries onto the
# end of this file.

to speed things up 'save as' to keep the original file and keep yours clean with only entries you need
All the best!

:--------------------------------------:
fugitive.gif

[URL unfurl="true"]http://mostarnet.com[/url]

All around in my home town,
They tryin' to track me down...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top