On Thu, 15 Nov 2012 20:07:38 -0500, Roy Smith wrote:
>>> gethostbyname() and getaddrinfo() use the NSS (name-service switch)
>> mechanism, which is configured via /etc/nsswitch.conf. Depending upon
>> configuration, hostnames can be looked up via a plain text file
>> (/etc/hosts), Berkeley DB file
In article ,
Nobody wrote:
> That's because the high-level routines aren't tied to DNS.
This is true.
>> gethostbyname() and getaddrinfo() use the NSS (name-service switch)
> mechanism, which is configured via /etc/nsswitch.conf. Depending upon
> configuration, hostnames can be looked up via a
On Wed, 14 Nov 2012 20:49:19 -0500, Roy Smith 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 t
In article ,
Chris Angelico wrote:
>On Thu, Nov 15, 2012 at 3:20 AM, Roy Smith wrote:
>>
>> My first thought to solve both of these is that it shouldn't be too
>> hard to hand-craft a minimal DNS query and send it over UDP. Then, I
>> hunted around a bit and found that somebody had already don
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 nor
On 11/14/2012 09:21 PM, Chris Angelico wrote:
> On Thu, Nov 15, 2012 at 1:10 PM, Roy Smith wrote:
>> In article ,
>> Chris Angelico wrote:
>>
>>> Indeed. But Python boasts that the batteries are included, and given
>>> the wealth of other networking facilities that are available, it is a
>>> bit
On Thu, Nov 15, 2012 at 1:10 PM, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> 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.
In article ,
Chris Angelico wrote:
> 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.
Think of the socket and struct modules as a pile of carbo
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 routin
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 se
On Thu, Nov 15, 2012 at 3:20 AM, Roy Smith wrote:
> I wrote:
>>> Oh, my. You're using DNS as a replacement for ping? Fair enough. In
>>> that case, all you really care about is that you can connect to port 53
>>> on the server...
>>>
>>> s = socket.socket()
>>> s.connect(('8.8.8.8', 53))
>
> In
I wrote:
>> Oh, my. You're using DNS as a replacement for ping? Fair enough. In
>> that case, all you really care about is that you can connect to port 53
>> on the server...
>>
>> s = socket.socket()
>> s.connect(('8.8.8.8', 53))
In article ,
Chris Angelico wrote:
>That assumes that (a) the
On Nov 14, 2012, at 9:22 AM, Roy Smith wrote:
> In article ,
> William Ray Wing wrote:
>
>> On Nov 13, 2012, at 11:41 PM, Roy Smith wrote:
>>
>>> In article ,
>>> w...@mac.com wrote:
>>>
I need to time the operation of a command-line utility (specifically
nslookup) from within a p
On Thu, Nov 15, 2012 at 1:22 AM, Roy Smith wrote:
> Oh, my. You're using DNS as a replacement for ping? Fair enough. In
> that case, all you really care about is that you can connect to port 53
> on the server...
>
> import socket
> import time
> s = socket.socket()
> t0 = time.time()
> s.conne
In article ,
William Ray Wing wrote:
> On Nov 13, 2012, at 11:41 PM, Roy Smith wrote:
>
> > In article ,
> > w...@mac.com wrote:
> >
> >> I need to time the operation of a command-line utility (specifically
> >> nslookup) from within a python program I'm writing.
> >
> > Ugh. Why are you d
w...@mac.com wrote:
>...
>However, if I try the same operation in the python interpreter using
>subprocess.Popen like so:
>
import subprocess
result = subprocess.Popen(['time', 'nslookup', 'www.es.net', '8.8.4.4'],
shell = False, stdout = subprocess.PIPE, stderr =
subprocess.
w...@mac.com writes:
> I need to time the operation of a command-line utility (specifically
> nslookup) from within a python program I'm writing. I don't want to use
> python's timeit function because I'd like to avoid python's subprocess
> creation overhead. That leads me to the standard UNI
On Nov 13, 2012, at 11:41 PM, Roy Smith wrote:
> In article ,
> w...@mac.com wrote:
>
>> I need to time the operation of a command-line utility (specifically
>> nslookup) from within a python program I'm writing.
>
> Ugh. Why are you doing this? Shelling out to nslookup is an incredibly
> s
In article ,
w...@mac.com wrote:
> I need to time the operation of a command-line utility (specifically
> nslookup) from within a python program I'm writing.
Ugh. Why are you doing this? Shelling out to nslookup is an incredibly
slow and clumsy way of doing name translation. What you really
I need to time the operation of a command-line utility (specifically nslookup)
from within a python program I'm writing. I don't want to use python's timeit
function because I'd like to avoid python's subprocess creation overhead. That
leads me to the standard UNIX time function. So for examp
20 matches
Mail list logo