Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'wed,': 0.03; 'test,': 0.04; 'https': 0.07; 'python': 0.08; 'hosts': 0.09; 'internally': 0.09; 'subject:DNS': 0.09; 'pm,': 0.10; 'received:209.85.214.174': 0.14; 'received:mail-iw0-f174.google.com': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'curl': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handshake': 0.16; 'header:In- Reply-To:1': 0.21; 'file,': 0.22; 'trying': 0.23; 'subject:Question': 0.25; 'function': 0.25; 'message- id:@mail.gmail.com': 0.28; 'received:209.85.214': 0.28; 'calling': 0.31; 'to:addr:python-list': 0.33; 'chris': 0.34; 'points': 0.34; 'force': 0.34; 'dns': 0.35; 'test.': 0.35; 'using': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'case': 0.37; 'domain': 0.38; 'edit': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'should': 0.39; 'received:209': 0.39; 'don\x92t': 0.39; 'either': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'ipb': 0.84; 'touching': 0.84; 'exposing': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=maYhoH+n2lhZT97wY2Oq1PsBFKjA3Vx+pqPC84ZLIQE=; b=HG6kboVkPxzL1CC4RoAcHnHljFWuOlfHXm4yE4IDElHBTNv8CcAKin65bVyw7Hildy CnG0wiybojPPTt6UU6ojqjaP40AZvkAjKe6RCYqBPszSXMiBj5Wy2CjbpKfR1LwmmwZ1 EvvMKdA4ptjPNKEEtx64320JKBrE4aquVLI6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=r+hcq2Y/3PeaikeWj/TNzxWc4s6PhECBlaFvSx09epa7yDiCd3MtYIDObC3Jus2QEJ X/XIU/ZhEeeqOORDpurQbI2X1rH4nzs2jDtFOMybAbATT9YWRifXJ/lBO0STHLc0RNHm E71L9JdWA/0wG+idmMWU8dYin0INi00l7JnSQ= MIME-Version: 1.0 In-Reply-To: <13FAA3D4-ED1D-47AC-BADA-FD5C2D3729B7@gmail.com> References: <13FAA3D4-ED1D-47AC-BADA-FD5C2D3729B7@gmail.com> Date: Wed, 15 Jun 2011 16:45:11 +1000 Subject: Re: Question regarding DNS resolution in urllib2 From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 17 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308120314 news.xs4all.nl 49041 [::ffff:82.94.164.166]:36607 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7674 On Wed, Jun 15, 2011 at 4:23 PM, saurabh verma wro= te: > But in the case of https , I can do above because https handshake is base= d on the domain i am trying to connect , so lets say I want to following in= side a python =A0script using libcurl2 but without touching /etc/hosts , > > curl =93https://something.com=94 , now something.com will try to connect = to either IPA or IPB which I don=92t have control over , I know internally = it must be calling a DNS resolver libarary of python , I want to control ov= er that , may be libcurl2 exposing a function to do some DNS altering . If you edit your hosts file, it will affect where something.com points - you can force it to be IPA and then test, then force it to IPB and test. You'll still be downloading https://something.com so the HTTPS handshake should work exactly the same way. Chris Angelico