[Samba] host lookup while printing

dave at nexicon.ca dave at nexicon.ca
Mon Jul 22 14:35:26 GMT 2002

I was experiencing a big delay in opening printers served from a Samba 
station on workstations running both Win2k and WinXP. The delay occurs 
whenever anything specific to the printer is opened. For example bringing up 
the job queue for the printer and opening the properties dialog for the 
printer both produce the delay. Cranking up the logging level and combing 
through showed the delay was being caused by a name lookup for the 
workstation connecting to the Samba server. 

A clip from the log file where you can see the 10 second gap between the 3rd 
and 4th items: 

[2002/07/19 14:09:47, 4] 
 Found policy hnd[0] [000] 00 00 00 00 03 00 00 00  00 00 00 00 0B 72 38 3D  
........ .....r8=
[2002/07/19 14:09:47, 4] lib/util.c:dump_data(1537)
 [010] 73 49 00 00                                       sI..
[2002/07/19 14:09:47, 3] libsmb/namequery.c:resolve_hosts(808)
 resolve_hosts: Attempting host lookup for name TWWS4<0x20>
[2002/07/19 14:09:57, 0] 
 connect_to_client: Can't resolve address for TWWS4
[2002/07/19 14:09:57, 5] rpc_parse/parse_prs.c:prs_debug(60)
 000000 spoolss_io_r_rffpcnex
[2002/07/19 14:09:57, 5] rpc_parse/parse_prs.c:prs_werror(618)
     0000 status: WERR_OK 

When the server can correctly resolve the name through the hosts file or 
lmhosts file it tries to connect to the workstation: 

[2002/07/19 14:10:15, 3] libsmb/namequery.c:resolve_hosts(808)
 resolve_hosts: Attempting host lookup for name TWWS4<0x20>
[2002/07/19 14:10:15, 3] lib/util_sock.c:open_socket_out(845)
 Connecting to at port 445
[2002/07/19 14:10:15, 2] lib/util_sock.c:open_socket_out(874)
 error connecting to (Connection refused)
[2002/07/19 14:10:15, 3] lib/util_sock.c:open_socket_out(845)
 Connecting to at port 139 

Even when it tries to connect it isn't successful: 

[2002/07/19 14:10:16, 0] 
 attempt_netbios_session_request: TWWS4 rejected the session for name 
*SMBSERVER with error Called name not present
[2002/07/19 14:10:16, 0] 
 connect_to_client: machine TWWS4 rejected the NetBIOS session request.
[2002/07/19 14:10:16, 5] rpc_parse/parse_prs.c:prs_debug(60)
 000000 spoolss_io_r_rffpcnex 

Because I use dynamic IPs on my lan I can't keep the hosts or lmhosts files 
up to date with all of the name to ip mappings. So I changed
name resolve order = lmhosts
and then left the lm hosts file blank. Now there is no delay for the name 
lookup, but the connection back to the workstation is never made. Printing 
proceeds as normal, seemingly with full functionality. Why is the server 
trying to connect back to the workstation when a printer is explored? What 
information is communicated on this socket? As printing can proceed normally 
without it, is there a way to disable it? 

I'd like to change my name resolve order back to something sensible, but 
can't afford to reintroduce a 10-20 second delay every time someone wants to 
use the printer. The client just hangs during this delay (Yay windows 
networking drivers!). 

I thought the 'talkback' socket might be produced by the underlying printing 
demon, CUPS in this case, but disabling cups still produces the socket 
attempt, so it seems like it's coming from something internal to Samba. 

Anyone have any ideas? 


More information about the samba mailing list