[Tutor] problem with reading dns query

Alan Gauld alan.gauld at btinternet.com
Sat Jul 2 15:38:03 CEST 2011


"preetam shivaram" <m.preetam93 at gmail.com> wrote

> browser, chrome for instance, and i want to search for 
> the ip of the domain name, say `www.google.com`. 

I'm curious why you would want to?
Given the volatility of IP addresses in the modern 
network I'm not sure what good it would do you? 
(as opposed to doing it manually using standard 
networking tools like ping, traceroute etc)

> `127.0.0.1` where my server (written in Python) 
> is running. 

localhost is not usually a good place to test 
networking tools. Even if you used a local 
LAN IP address allocated via DHCP it would 
be slightly more realistic.

> is there any better way to get the dns request 
> fro my browser first ,extract  the domain name 
> and then send it to a name server that i wish 
> all in python

You could set your local DNS settings to your 
local server. But if you want to reroute DNS I 
suspect there are esierways. But I'm still not 
clear about what you really want to do here, 
or why?

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list