Bug 11227 - Using SMB2 resolves host name to IP address
Summary: Using SMB2 resolves host name to IP address
Status: NEW
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.0.7
Hardware: All All
: P5 major (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2015-04-20 13:24 UTC by Mike
Modified: 2015-05-20 18:32 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2015-04-20 13:24:15 UTC
For cluster servers, we don't want host names resolved to IP addresses by smbclient, using smbclient 4.0.7. We put the hostname in the smb.conf file. If we force using NT1, the hostname is sent fine to the server, but if we send using SMB2/3, the hostname gets resolved to an IP address, and we fail. Here is the content of the smb.conf file:


        unix charset = UTF-8

        interfaces =
        default service = dev3k1.myserver.com
        path = /ScanShare
        client ntlmv2 auth = yes
        client max protocol = SMB3

The invocation of the client is:
  smbclient -s /etc/smb.conf -U user%pass
Comment 1 Jeremy Allison 2015-04-21 20:15:04 UTC
Try setting "name resolve order" in smb.conf...
Comment 2 Mike 2015-05-20 18:32:09 UTC
I've tried different permutations of the "name resolve order", but if I take away too many options, it fails, otherwise it always resolves the hostname to an IP address. 

It uses 2 different functions to send the Tree Connect Andx Request for NT1 and Tree Connect Request for SMB2.

I've tried disable "netbios = yes", because we also don't support that anymore. I saw in the code some of the functions were checking it.

I know I the functions in question are internal_resolve_name, and I don't see it checking for any config value NOT do resolve the hostname to an IP.

In 3.6.5 we just made sure the smb.conf file EITHER had an IP or hostname because of clusters, based on the following article:

The Microsoft technet article on 2008 clusters


I'm sure other people had this issue and resolved it. Either the client has to be told to send the hostname for SMB2, or something on the server has to be configured differently so it can accept IP addresses for these configurations.