Web dev in python
i am still a novice in these areas so here is my question:
I want to see the dns request sent out by my browser (say chrome).so i set up a udp server in python with host='' and port=21567(can be anything other than the previlaged and reserved ones).i set my server to listen for connections using the udp.recvfrom(1024) and set the proxy in my browser to localhost and respective port number so my browser should send the request to my server when i type in a url right??? is that right??? if it is开发者_StackOverflow社区 then my server is not detecting a connection if it is wrong then please tell me the actual mechanism in technical details Thanks in advance
Setting up a proxy in your browser tells it where to make TCP connections; it doesn't have anything to do with how it queries DNS, which is determined by your operating system's resolver.
For Linux you'd just shut down bind, e.g. Debian /etc/init.d/bind9 stop
; then your Python script would catch the traffic on port 53. And make sure nameserver 127.0.0.1
is at the top of /etc/resolv.conf.
For Windows you'll need to set your DNS to the localhost (127.0.0.1), somewhere in the network settings.
精彩评论