[Samba] Help: issues about hostname & nameserver

tubocurarine tubocurarine at 163.com
Thu Apr 28 04:31:08 MDT 2011


Hi,

Thanks a lot for your detailed and excellent explanation. 

Everything goes well now.

Best regards.
Tubo.

At 2011-04-28 14:31:46,"L.P.H. van Belle" <belle at bazuin.nl> wrote:

Hi,
 
if you do : 
hostname -f   = hostname in FQDN
hostname -d = only domainname.
hostname = the hostname itselve.
 
if the command hostname gives the FQDN hostname then set the hostname again with hostname -F /etc/hostname
in /etc/hostname there should be the FQDN hostname inlike hostname.domain.tldit and reboot your server.
 
in this example: host.name.domain.tld  the hostname = host
name.domain.tld = subdomain.domain.tld
 
thats why i say dot in hostname is not RFC compliant.
 
you could set the correct domain search first.   ( adjust to your own domain name. )
/etc/resolv.conf
domain subdomain.domain.tld
search subdomain.domain.tld  domain.tld
## if running use own dns first
nameserver 127.0.0.1
## internet DNS servers
nameserver iphere
nameserver iphere
 
if this file changes every reboot, or if you use dhcp client for your server.
look for /etc/dhcp3/dhclient.conf  ( i use debian for you info, so dhclient.conf can be in other directory )
change it like this.
supersede domain-name "subdomain.domain.tld";
supersede domain-search "subdomain.domain.tld  domain.tld";
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        netbios-name-servers, netbios-scope, interface-mtu,
        rfc3442-classless-static-routes;

this correctes the search order in /etc/resolv.conf
 
now resolv.conf should be always correct.
 
if this is checks, next part.
in samba's smb.conf check if these line exists
 
name resolve order = wins host lmhosts bcast
dns proxy = yes

if you use dns, which i think you do, and also  dhcpserver on your server which i guess also.
the you should setup dynamic dns. ( its not that hard to set this up.)
 
i guess you problem is the dhcpserver/dns setup.
 
check all of the above and report back.
 
Best regards,
 
Louis
 
 


Van: tubocurarine [mailto:tubocurarine at 163.com]
Verzonden: 2011-04-28 03:04
Aan: L.P.H. van Belle
Onderwerp: Re:Re: [Samba] Help: issues about hostname & nameserver


Thanks for your reply.

But both the wikipeida (http://en.wikipedia.org/wiki/Hostname) and documents provided by CentOS (http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-sysconfig-network.html) point out that they should be Fully Qualified Domain Name (FQDN), such ashostname.expample.com.

And also, that does not make sense for the 2nd case in the previous mail.

What's more, I'm interested in how Samba treat the server's hostname. But I failed to search it through the code.

Help, please.

Thanks.
Tubo.




At 2011-04-27 18:41:22,"L.P.H. van Belle" <belle at bazuin.nl> wrote:

>A dot in hostname is not RFC compliant,
>so change the servers hostname. 
>
>Louis
>
>
>>-----Oorspronkelijk bericht-----
>>Van: tubocurarine at 163.com 
>>[mailto:samba-bounces at lists.samba.org] Namens tubocurarine
>>Verzonden: 2011-04-27 12:03
>>Aan: samba at lists.samba.org
>>Onderwerp: [Samba] Help: issues about hostname & nameserver
>>
>>Dear developers:
>>
>>I'm using Samba-3.5.8 on Linux (Gentoo, amd64) as a file 
>>server, and using some Windows based OSes as clinet. And 
>>something strange happened to me.
>>
>>Things went as follows:
>>
>>1. If there was no dot (".") in the hostname of server, then 
>>no matter whether the DNS server (in /etc/resolv.conf) was set 
>>correctly or not, everything went fine. Client can access 
>>shares (provided server) normally.
>>
>>2. If there was dot in hostname of server, and if the DNS 
>>Server was set correctly (or just left as blank), server 
>>worked normally.
>>
>>3. If there was dot in hostname of server, and the DNS Server 
>>was set incorrectly, all client could not connect to the 
>>server, with a message indicated that the address of server 
>>could not be accessed.
>>
>>My friend and I payed some time on it. We found that in the 
>>last situation, the Samba server may spend a long time to look 
>>up the computer name (name of server or client). But before 
>>the look up ends, the client would treat this as a timeout.
>>
>>I don't know whether we are right about this. And if we were, 
>>why everything goes fine in the 2nd case?
>>
>>Any information will be appreciated.
>>
>>Best regards.
>>
>>Tubo
>>
>>2011-04-27
>>
>>-- 
>>To unsubscribe from this list go to the following URL and read the
>>instructions:  https://lists.samba.org/mailman/options/samba
>>
>>
>
>




体验网易邮箱2G超大附件,轻松发优质大电影、大照片,提速3倍!


More information about the samba mailing list