[Cialug] saving a step in rdns lookups

Matthew Nuzum newz at bearfruit.org
Tue Nov 4 15:18:07 CST 2008


BTW, thanks a bunch Jeff, I've been using this and it works great.

2008/10/8 Jeffrey Ollie <jeff at ocjtech.us>:
> On Wed, Oct 8, 2008 at 10:38 AM, Matthew Nuzum <newz at bearfruit.org> wrote:
>> Here is a task I do frequently:
>>
>> $ host <some hostname>
>> <some hostname> has address 11.22.33.44
>> /me copies and pastes the ip address
>> $ host <pastes ip address>
>> w.x.y.z.in-addr.arpa domain name pointer <some hostname>
>>
>> So I'm wondering, is there a way in one command to put in a hostname
>> and get out the reverse dns hostname for the machine? The reason is I
>> deal with numerous virtual hosts and I have a hard time remembering
>> which hosts are on which servers (and it doesn't help that they have a
>> tendency to move around without notice).
>
> I've attached a short little Python script that should fit the bill.
> Aside from Python itself you'll need the dnspython library[1].  It's
> available on Fedora/RedHat systems as python-dns.  Ubuntu/Debian
> probably has it as well but I don't know what the package would be
> called.
>
> $ python rdns-check.py www.google.com
> www.google.com.
>    -> 72.14.205.147
>        -> qb-in-f147.google.com.
>
>    -> 72.14.205.99
>        -> qb-in-f99.google.com.
>
>    -> 72.14.205.103
>        -> qb-in-f103.google.com.
>
>    -> 72.14.205.104
>        -> qb-in-f104.google.com.
>
> --
> Jeff Ollie
>
> "You know, I used to think it was awful that life was so unfair. Then
> I thought, wouldn't it be much worse if life were fair, and all the
> terrible things that happen to us come because we actually deserve
> them? So, now I take great comfort in the general hostility and
> unfairness of the universe."
>
>        -- Marcus to Franklin in Babylon 5: "A Late Delivery from Avalon"
>
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
>



-- 
Matthew Nuzum
newz2000 on freenode


More information about the Cialug mailing list