Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'reason,': 0.07; 'subject:two': 0.07; 'python': 0.09; 'high-level': 0.09; 'library': 0.15; 'slightly': 0.15; 'stack': 0.15; 'batteries': 0.16; 'bind': 0.16; 'boasts': 0.16; 'caring': 0.16; 'dig': 0.16; 'included,': 0.16; 'roy': 0.16; 'subject:questions': 0.16; 'wrote:': 0.17; 'thu,': 0.17; '>>>': 0.18; 'sender:addr:gmail.com': 0.18; 'all,': 0.21; 'bit': 0.21; 'exists.': 0.22; '15,': 0.23; "python's": 0.23; 'seems': 0.23; 'random': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; '(most': 0.27; 'skip:( 20': 0.28; 'chris': 0.28; 'run': 0.28; 'servers.': 0.29; 'surprised': 0.29; 'writes:': 0.29; 'probably': 0.29; "i'm": 0.29; 'that.': 0.30; 'query': 0.30; 'basic': 0.30; 'point': 0.31; 'received:209.85.160.46': 0.32; 'choices': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'server': 0.35; 'decisions': 0.35; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; "didn't": 0.36; 'level': 0.37; 'being': 0.37; 'quite': 0.37; 'received:209': 0.37; 'far': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'application': 0.40; 'where': 0.40; 'think': 0.40; 'your': 0.60; 'networking': 0.60; 'most': 0.61; 'skip:n 10': 0.63; 'deeply': 0.66; 'facilities': 0.69; 'smith': 0.71; 'article': 0.78; 'routines': 0.84; 'serious': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=lShH/hHXAKVyLSAmE1iCJsIwN+Xl8J3AVeDqcRyTiqw=; b=S2WE+C8taQWyjUadeYdhQom2B0wiy1VrQD9WfyNWmBQoq/v4yDaaLwnIzSkpjgMsJy uhRM2wxPVSFz9ua0IMAIPMDqN0t7n4GnakvzzLaUaJS2T/qnzIIZHlLdOHHNrxBQFuYg C0ACfR4Te1r+DSi73n3pGAsgQsllHK0xXOVvcYwmyzY7ejs5AGbNuI7eqiuM2apkEF33 0mWhmISz7RtSVLM67yMxXyB+MT/ATVEJrF5OHeduObMnrb2i40TnOjSMob1e52LN3dOi yTPFQz+1htTHGcCsFRhkJWFw7pBilHqZxCgAOPLLI0GFAPj2zvFhcRrhyOiSfXjcgTDa cwPA== Sender: Kushal Kumaran From: Kushal Kumaran To: python-list@python.org Subject: Re: Subprocess puzzle and two questions In-Reply-To: References: User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/24.1.1 (x86_64-pc-linux-gnu) Date: Thu, 15 Nov 2012 10:23:08 +0530 MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352955207 news.xs4all.nl 6982 [2001:888:2000:d::a6]:46106 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33370 Chris Angelico writes: > On Thu, Nov 15, 2012 at 12:49 PM, Roy Smith wrote: >> In article , >> Chris Angelico wrote: >> >>> I'm slightly surprised that there's no way with the Python stdlib to >>> point a DNS query at a specific server >> >> Me too, including the "only slightly" part. The normal high-level C >> resolver routines (getaddrinfo/getnameinfo, or even the old >> gethostbyname series), don't expose any way to do that. You have to dig >> quite far down in the resolver library stack to get to the point where >> you can do that. The concept of not knowing or caring which specific >> server has the data you need is quite deeply baked into the basic DNS >> architecture. > > Indeed. But Python boasts that the batteries are included, and given > the wealth of other networking facilities that are available, it is a > bit of a hole that you can't run DNS queries in this way. > > Mind you, if Python's managed to get this far without it being a major > stumbling-block, that probably means that it's not a serious lack. And > I don't think many people write DNS *servers* in Python. (Most people > don't write DNS servers at all, since BIND exists. But I did exactly > that this week, since it would be easier than most other options.) > Indeed. Most people would prefer if random applications didn't make their own decisions about using specific DNS servers. That way, the users can make their own configuration choices (gai.conf, nsswitch.conf) according to their site preferences. If your application needs that level of control (if you're writing a nslookup replacement for some reason, perhaps), dnspython (www.dnspython.org) seems to have it. -- regards, kushal