connect to shared folder via hosts file

Discussion in 'Server Networking' started by John A Grandy, Aug 13, 2008.

  1. Server 2003 R2 Enterprise x64 Edition SP2
    IP = 10.1.0.154
    Computer Name = SERVER_1


    XP Professional 2002 SP3
    IP = 10.1.0.165
    Computer Name = WORK_1



    SERVER_1 has shared folder \xfer\

    On WORK_1 , in the hosts file on , I have

    10.1.0.154 SVR_DB


    On the XP box , I try to open the shared folder via Start > Run >
    \\SVR_DB\xfer ...

    I receive the error :


    You were not connected because a duplicate name exists on the nework. Go to
    System in Control Panel to change the computer name and try again.


    There is no box on the network named SVR_DB . SVR_DB only exists once in my
    local hosts file.


    What could be causing this problem ?
     
    John A Grandy, Aug 13, 2008
    #1
    1. Advertisements

  2. Robert L. \(MS-MVP\), Aug 13, 2008
    #2
    1. Advertisements

  3. I suspect you'd need to use LMHOSTS instead of HOSTS here, and the syntax
    for that file eludes me as it's been so long since I used one.
    Does it work when you use \\server_1\xfer ?
    Are you using AD?
     
    Lanwench [MVP - Exchange], Aug 13, 2008
    #3
  4. Pinging SVR_DB does reply from IP 10.1.0.154


     
    John A Grandy, Aug 13, 2008
    #4
  5. Yes, running \\SERVER_1\XFER opens a window onto that directory.

    I am on a workgroup, no AD.

    What is the difference between LMHOSTS and HOSTS ?


    "Lanwench [MVP - Exchange]"
     
    John A Grandy, Aug 13, 2008
    #5
  6. John A Grandy

    Bill Grant Guest

    HOSTS is the one to use with DNS style names. DNS was developed to
    overcome the limitations of HOST files (way back in the past when the
    Internet was very new).

    LMHOSTS is the one to use with Netbios names. WINS grew out of LMHOSTS
    to overcome its limitations.
     
    Bill Grant, Aug 14, 2008
    #6
  7. Yep.

    See

    How to Write an LMHOSTS File for Domain Validation and Other Name Resolution
    Issues
    http://support.microsoft.com/kb/314108

    ....and to the OP: what's the reason you feel the need to address your server
    by another name anyway?
     
    Lanwench [MVP - Exchange], Aug 14, 2008
    #7
  8. It's an application configuration issue.

    The application connects to db using "SVR_DB" in the connection string. The
    HOSTS file maps that name to the actual ip of the db server.

    Why would HOSTS vs LMHOSTS matter ?


    "Lanwench [MVP - Exchange]"
     
    John A Grandy, Aug 15, 2008
    #8
  9. Because it's NetBIOS ?

    I've never tried doing what you're doing, so it's hard for me to be more
    specific, but do check out the LMHOSTS article I linked. I used to use
    LMHOSTS back in the day when my VPN clients needed to map to remote shares
    on NT servers.
     
    Lanwench [MVP - Exchange], Aug 15, 2008
    #9
  10. Ok, I created an LMHOSTS file with the mapping :

    10.1.0.154 SVR_DB #PRE



    I then ran "nbtstat -R" to purge/reload the NBT Remote Cache Name Table

    "nbstat -c" shows that I have multiple mappings for the (name,ip) pair :

    NetBIOS Remote Cache Name Table

    Name Type Host Address Life[sec]
    ----------------------------------------------------------
    SVR_DB <03> UNIQUE 10.1.0.154 -1
    SVR_DB <03> UNIQUE 10.1.0.154 -1
    SVR_DB <03> UNIQUE 10.1.0.154 -1


    Not sure how 3 mappings got into the cache , but when I attempt to open the
    folder \\SVR_DB\XFER I still receive the same error :

    "You were not connected because a duplicate name exists on the network. Go
    to System in Control Panel to change the computer name and try again."


    Could this error actually have nothing to do with whether LMHOSTS is present
    or not , and be due to other workstations on this network having identical
    HOSTS files ?






    "Lanwench [MVP - Exchange]"
     
    John A Grandy, Aug 15, 2008
    #10
  11. Ooops , that should have been :

    NetBIOS Remote Cache Name Table

    Name Type Host Address Life[sec]
    ----------------------------------------------------------
    SVR_DB <03> UNIQUE 10.1.0.154 -1
    SVR_DB <00> UNIQUE 10.1.0.154 -1
    SVR_DB <20> UNIQUE 10.1.0.154 -1



     
    John A Grandy, Aug 15, 2008
    #11
  12. John A Grandy

    Bill Grant Guest

    You get three entries for the computer name because it has registered
    three services. 00 is the name for the WINS client service, 03 for the
    messenger service and 20 for the server service. For other possible Netbios
    special names (machine names and domain names) see KB 119495 .
     
    Bill Grant, Aug 16, 2008
    #12
  13. John A Grandy

    Elwood Guest

    I'm not sure if you found the answer, but 2003 server has a security
    "feature" that does not allow it to answer to aliases.

    Try this:

    Connecting to SMB Share on a Windows 2000-Based Server May Not Work with an
    Alias Name
    http://support.microsoft.com/?id=281308
     
    Elwood, Nov 11, 2008
    #13
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.