Confusing Samba issue

undomielundomiel Member Posts: 2,818
Yesterday I ran into an issue where I wasn't able to connect to my samba share from the windows machine. Did some troubleshooting later on it and even on the local machine I was getting an NT_STATUS_CONNECTION_REFUSED error when testing with smbclient. After a while of troubleshooting I tracked it down to there being an entry in the /etc/hosts file that set my machine name to 127.0.0.2. Eliminating that entry fixed everything for all of the machines. Now my question is, why would this affect the external machines? They're pulling DNS from the router and it was returning the proper ip address, so there really shouldn't have been a problem with accessing the machine from the remote machines. Why would a hosts entry on the local machine confuse samba? Access by ip address worked fine before the problem was fixed, so I'm not really understanding why the hosts entry would have caused any issues for the external machines. I did a search through the samba documentation but couldn't find any clues. Any ideas or explanations for why the hosts entry broke samba would be appreciated. Thanks!
Jumping on the IT blogging band wagon -- http://www.jefferyland.com/

Comments

  • ClaymooreClaymoore Member Posts: 1,637
    Our HPUX servers perform a reverse DNS lookup when the clients connect. If there is inconsitency between the host name, the IP address it is currently using to connect, and the Reverse DNS record, the connection is refused. The incorrect entry in your etc/hosts file could have caused the same thing.

    We would only run into a problem when a PC connected over VPN and grabbed an address from our regular DHCP pool. The client would release the address when it disconnected and a workstation in the office would grab that IP. All the DHCP and DNS registration seemed to be fine, but the Unix boxes would refuse the connection. This would happen very rarely, but deleting and re-registering the client IP address with DNS seemed to solve it. Now I use a separate DHCP pool for our VPN clients and the problem doesn't happen at all.
  • undomielundomiel Member Posts: 2,818
    That makes sense, except the erroneous entry was for the server itself so then wouldn't it be refusing more than just smb connections? ssh would work just fine for instance. Also now that I think about it with logging turned up samba wouldn't even show a blip for any attempted connections, so it would be something external to samba. But I brought down the firewall during troubleshooting so it shouldn't be the firewall either. What you're suggesting makes the most sense so far though.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
Sign In or Register to comment.