From owner-freebsd-net@FreeBSD.ORG Wed Dec 10 06:14:44 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 561F0106564A for ; Wed, 10 Dec 2008 06:14:44 +0000 (UTC) (envelope-from stutiredboy@gmail.com) Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by mx1.freebsd.org (Postfix) with ESMTP id EFF3F8FC1E for ; Wed, 10 Dec 2008 06:14:43 +0000 (UTC) (envelope-from stutiredboy@gmail.com) Received: by gxk12 with SMTP id 12so412904gxk.19 for ; Tue, 09 Dec 2008 22:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=xU/WZwKag0XEej8ZuQu4vE142vB8fT0LzlTwZUfAweQ=; b=j5Gmys3eQdRbF8qQJ378r9c7WgoHZNbtnYyhBziNRUo4ccmeGLWkqGVqnHAcDLsbaF hrhYaG75YleAfEfdSza6iHwRc0j6d9kmjBUxPu/jI4d1EwtzP4nOsJmbMtBPADnTAgXu HP1rldtmI5EKRqMuMIUPkZjTp3B15JedMplEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=f2xieEaWO3gJ3OiB40Mr/1O1AAlcXg3RhAJW+Ovo3pvkzctHjhdTJB7aS8R3kchMQR Ued4MK6j81YEX1DuZ++s7p5T1svPshGjiu8YYsZdo1Hp0VKEz4ZRzI+A5naLRL07awFU xSMGAxkMjgkMuNiYYZtfk9tDYdHhA96ArEjl8= Received: by 10.151.144.15 with SMTP id w15mr1500708ybn.6.1228888131500; Tue, 09 Dec 2008 21:48:51 -0800 (PST) Received: by 10.150.98.17 with HTTP; Tue, 9 Dec 2008 21:48:51 -0800 (PST) Message-ID: Date: Wed, 10 Dec 2008 13:48:51 +0800 From: "=?GB2312?B?s8LQocn6?=" To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: [help]strange problem about gethostbyname/getaddrinfo X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 06:14:44 -0000 hi,all,we have a project which must resolv some domains in the server process our system in FreeBSD 6.2 or 6.3, the server process may open 7000+ sockets,not fork we have set the maxopensockets as 65536,as follows: kern.ipc.numopensockets: 4737 kern.ipc.maxsockets: 65536 socket: 356, 65538, 4737, 6747, 64793968 and the follow is our limit info: cputime unlimited filesize unlimited datasize 2621440 kbytes stacksize 65536 kbytes coredumpsize unlimited memoryuse unlimited vmemoryuse unlimited descriptors 655000 memorylocked unlimited maxproc 5547 sbsize unlimited I am sure we have set the /etc/reslov.conf correctly, I can resolve any legal domain use dig or gethostbyname or getaddrinfo in my another test program The problem is we found when the server porcess open 1000+ or higher sockets(but we can query any legal domain in the system normally), the gethostbyname or getaddrinfo might fetch nothing(sometimes the query is ok), the gethostbyname's return error is: errno=2,strerror=Host name lookup failure and the getaddrinfo's return error is: "hostname nor servname provided, or not known", /* EAI_NONAME */ we have tried to use the tcpdump to analyse the query packets, unluckily , we catch nothing, seem like that the program does not query anything(or get none dns server,even 127.0.0.1) , neither using gethostbyname nor getaddrinfo,and we also try set the query type as tcp and udp, the same disappointment result. The stranger thing is we have tried to run another demo process which have open 4000+ sockets, all work well..so the problem might not related to open too much sockets..and we found that, even we set the /etc/resolve.conf nothing, normally the gethostbyname/getaddrinfo will check 127.0.0.1, and we can get the query packets The server process's query is under a single process not multi threads Can anyone help me analyse the error/problem, which may raise this situation or any useful info, thanks very much !