case sensitive hostnames?
tpot at valinux.com
Sat Jun 16 00:14:29 GMT 2001
Joe Doran writes:
> Funny you should bring this up.... :-).
> I have been looking at a problem of NT printing hanging in SCO
> openserver. I can now confirm the culprit.
> I have been looking at function static BOOL internal_resolve_name(). In
> it it parses tokens of hosts,lmhosts,wins, bcast ie the default search
The default search order is actually lmhosts, hosts, wins, bcast
but that doesn't matter in this case.
> However our DNS lookups are broken, and gethostbyname is possibly not
> fully qualified. Part of the print client handshake, appears to looking
> for the clients IP address. As the dns hangs and takes around 15/20
> seconds to return error, the client hangs and keeps retrying. Thereby
> the function never hits WINS lookup which would resolve the name. The
> result is that mounting RPC's appear to hang samba and eat up resources.
> I am hoping that my Temporary solution: shift name lookup order (fix
> broken DNS eventually :-) ) will reduce my resource problems ie
> NSTREAMS, and inet addr problems. So far, this afternoon at least it
> appears this way. I will get a better picture when I get back to the
> office on Monday.
> Anyone else any comment on this?
Aha! This is exactly the case that I am interested in. The
resolve_hosts() function called when a hostname is to be looked
up using the hosts method eventually calls Get_Hostbyname(). Now
this function tries the hostname as it is passed in, then all
lowercase then all uppercase. I want to get rid of the last two
checks because they only make the timeout worse when you have a
broken dns server.
But code has to be there for a reason right? (-: The bit of
code that does case sensitive dns lookups predates the use of CVS
in Samba. From the changelog:
- wrapped gethostbyname() with Get_Hostbyname() to prevent
case sensitive problems on name lookups
So I asked Andrew why he put this code in and he couldn't
I think I'll trash Get_Hostbyname and replace it with
More information about the samba-technical