Use Twisted and dnspython to deal with DNS data.