Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7674

Re: Question regarding DNS resolution in urllib2

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 <rosuav@gmail.com>
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 <E284F771-80D9-4F21-9935-1D61E76F8B01@gmail.com> <BANLkTik8pc5aAiS2Y0KQqPfa80jU1ckFDQ@mail.gmail.com> <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 <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.259.1308120313.11593.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Wed, Jun 15, 2011 at 4:23 PM, saurabh verma <nitw.saurabh@gmail.com> wrote:
> But in the case of https , I can do above because https handshake is based on the domain i am trying to connect , so lets say I want to following inside a python  script using libcurl2 but without touching /etc/hosts ,
>
> curl “https://something.com” , now something.com will try to connect to either IPA or IPB which I don’t have control over , I know internally it must be calling a DNS resolver libarary of python , I want to control over 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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Question regarding DNS resolution in urllib2 Chris Angelico <rosuav@gmail.com> - 2011-06-15 16:45 +1000

csiph-web