views:

352

answers:

2

Something which doesn't rely on native libraries would be even more better.

+2  A: 

twisted has an excellent pure-python implementation, see twisted.names sources (especially dns.py). If you can't use all of their code, maybe you can extract and repurpose their Record_SRV class from that file.

Alex Martelli
Went by the first answer posted, though thanks!
Gili Nachum
+2  A: 

You could try the dnspython library:

ars
Works thanks! import dns.resolveranswers = dns.resolver.query('_xmpp-server._tcp.gmail.com', 'SRV')for rdata in answers: print str(rdata)
Gili Nachum