On Fri, May 9, 2014 at 5:45 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Chris Angelico <ros...@gmail.com>: > >> Before you go too far down roads that are starting to look >> problematic: A DNS lookup is a UDP packet out and a UDP packet in >> (ignoring the possibility of TCP queries, which you probably won't be >> doing here). Maybe it would be easier to implement it as asynchronous >> networking? I don't know that Python makes it easy for you to >> construct DNS requests and parse DNS responses; > > That's what I ended up doing when I wrote my home SMTP server. > > It's more tedious than difficult. You don't need to have a ready-made > module for everything. An RFC and two hands take you far.
Be careful. A naive implementation can open you up to various security issues. In the case of DNS, source port randomization is important to the prevention of cache poisoning; if you don't know what I'm talking about, pick a language/library that does the work for you, rather than doing everything yourself :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list