Search Postgresql Archives

Re: function that resolves IP addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



give this a try if you don't mind using plperlu.  This was tested with Postgresql 8.0.3


create or replace function gethostbyaddr(inet) returns text
as
$$
use strict;
use Socket;
my $inet = $_[0];
my $iaddr=inet_aton($inet);
my $name = gethostbyaddr($iaddr,AF_INET);
return $name;
$$
language plperlu;

select gethostbyaddr('199.181.132.250'::inet);




---------- Original Message -----------
From: "Marcel Gsteiger" <Marcel.Gsteiger@xxxxxxxxxx>
To: <pgsql-general@xxxxxxxxxxxxxx>
Sent: Wed, 19 Oct 2005 14:36:46 +0200
Subject:  function that resolves IP addresses

> Hi all
> 
> Does anybody know how I could create a database function that accepts
> an INET parameter and reverse-lookups the hostname via DNS PTR lookup?
> Something like the dnsname command line utility in the djbdns package. I
> need this function for analyzing firewall logs stored in the database
> with ulogd.
> 
> Any idea would much be appreciated.
> 
> Regards
> --Marcel
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
------- End of Original Message -------


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux