Re: function that resolves IP addresses

Поиск
Список
Период
Сортировка
От Jim Buttafuoco
Тема Re: function that resolves IP addresses
Дата
Msg-id 20051019131547.M85610@contactbda.com
обсуждение исходный текст
Ответ на function that resolves IP addresses  ("Marcel Gsteiger" <Marcel.Gsteiger@milprog.ch>)
Список pgsql-general
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@milprog.ch>
To: <pgsql-general@postgresql.org>
Sent: Wed, 19 Oct 2005 14:36:46 +0200
Subject: [GENERAL] 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 -------


В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: getting around---division by zero on numeric
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: function that resolves IP addresses