mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
FS-3110 --comment-only phase 1 to replace udns with ldns in mod_enum may need to rerun bootstrap
This commit is contained in:
19
libs/ldns/contrib/python/examples/ldns-mx2.py
Executable file
19
libs/ldns/contrib/python/examples/ldns-mx2.py
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# MX is a small program that prints out the mx records for a particular domain
|
||||
#
|
||||
import ldns
|
||||
|
||||
resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
|
||||
|
||||
pkt = resolver.query("nic.cz", ldns.LDNS_RR_TYPE_MX,ldns.LDNS_RR_CLASS_IN)
|
||||
if (pkt) and (pkt.answer()):
|
||||
|
||||
for rr in pkt.answer().rrs():
|
||||
if (rr.get_type() != ldns.LDNS_RR_TYPE_MX):
|
||||
continue
|
||||
|
||||
rdf = rr.owner()
|
||||
print rdf," ",rr.ttl()," ",rr.get_class_str()," ",rr.get_type_str()," ",
|
||||
print " ".join(str(rdf) for rdf in rr.rdfs())
|
||||
|
Reference in New Issue
Block a user