Domain name lookup helper for python?

Share

Hi. I have a list of the domain portion of URLs which looks a bit like this:

Whois lookup for fycnds.digitalpoimt.com
Whois lookup for wvgpzdea.digitalpoimt.com
Whois lookup for zhnsht.digitalpoimt.com
Whois lookup for frigo25.php5.cz
Whois lookup for handrovina.php5.cz
Whois lookup for blabota.php5.cz
Whois lookup for pctuzing.php5.cz
Whois lookup for viagraviagra.php5.cz
Whois lookup for poiu.php5.cz
Whois lookup for flasa.php5.cz
Whois lookup for yoy4.digitalpoimt.com
Whois lookup for hskly.digitalpoimt.com
Whois lookup for 2i0wjwbc.digitalpoimt.com
Whois lookup for harnhjc.digitalpoimt.com
Whois lookup for gqru.digitalpoimt.com

I need some code which determines which portion of these hostnames is a whois-able domain name. My problem is this doesn’t seem all that simple to do — some countries have a second layer of TLDs, and some do not.

Does anyone know of a python library, or failing that simple algorithm, which will do this for me?

(For those left wondering, I am trying to do some analysis of the spam I get on this blog, and for that I want to know if the whois information for a domain that left a suspect comment indicates anything suspicious.)

Share

Twisted conch

Share

It seems to me that every time I go to write some networking code in Python, the twisted guys have got there before me. Today’s adventures are involving twisted conch, which seems very cool. The documentation is a bit patchy though.

Share

Twisted Python and Jabber SSL

Share

Ok, so I thought it would be cool to be able to send Google Talk messages to my MythTV box. Can’t be too hard to write a twisted python jabber client can it? Well, after an hour of surfing, I give up. I have the simple jabber client example, but it totally doesn’t work with the Google servers, I suspect because it doesn’t do SSL. I can see one of the twisted.words maintainers filing bugs against the xish stuff too, which I suspect means it’s going to be a while.

A little bit disappointing me thinks.

Share

Python DNS modules

Share

My first python script involves doing some DNS lookups (for TXT records if that matters), and I am currently working through using the pydns module for this. Is this really the best DNS module to use for python though? For a start, it was last released in May 2002, and the documentation is somewhat sparse…

Share

Example 2.1 from Dive Into Python

Share

I’ve just started working through Dive Into Python, so I don’t really have an opinion of the book yet. I did notice that Example 2.1 produces different output on my machine than from the example…

The example says I should get:

    server=mpilgrim;uid=sa;database=master;pwd=secret
    

I get:

    pwd=secret;database=master;uid=sa;server=mpilgrim
    

It’s interesting that this is exactly the reverse of what the book says I should get. I have no idea why, as I can’t read Python yet, but there you go.

Share