From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3401d69f41053824dc944b92ffb0f3f1@plan9.bell-labs.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] csipinfo Date: Wed, 18 Oct 2006 17:29:01 -0400 From: geoff@plan9.bell-labs.com In-Reply-To: <365a3b8e0ce821506adb926ac1001503@plan9.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: cd168cc4-ead1-11e9-9d60-3106f5b1d025 smtpd does a lot of this sort of DNS lookup. If all you want is to map an IP address back to a domainname, this one line from /sys/src/cmd/upas/smtp/greylist.c:265 should suffice: fqdn = csgetvalue(nil, "ip", nci->rsys, "dom", nil); where nci->rsys is a string containing a dotted-quad address like "135.104.9.82" for IPv4.