nslookup/config question

F

Frank Goodman

Apologies in advance if this is the wrong place to post, appreciate any
pointers to the right place if I've polluted the wrong thread

Specifics:
ruby 1.8.2 (2004-12-25) [i686-linux]
Host: Linux gentoo 2.6.12

My linux box does not run a nameserver, as it is a home machine that I use
for development. I connect to the internet through a Dlink router and
cable-modem.

When I do a Socket/TCPSocket.gethostbyname call from within ruby, for
"unknown" hosts it returns an array that corresponds to my DynDNS domain name
with my "public IP address"

When I run `nslookup` it returns:

** server can't find foo.foobar.frt: NXDOMAIN

With the socket version it is more complicated for me to determine bad hosts
and I certainly can't do it in a portable way, so I'd like to set things up so
the Ruby.Socket code returns a proper error.

I'm guessing this has something to do with my (improper) configuration of my
system or router. Any help would be appreciated

I am curious why I would get different behaviours from the Ruby gethostbyname
and nsslookup which I would imagine should resolve down to a gethostbyname
call as well.

Ideas?

Again, apologies if I've posted to the wrong place.
 
E

Eric Hodel

Apologies in advance if this is the wrong place to post, appreciate
any
pointers to the right place if I've polluted the wrong thread

Specifics:
ruby 1.8.2 (2004-12-25) [i686-linux]
Host: Linux gentoo 2.6.12

My linux box does not run a nameserver, as it is a home machine
that I use
for development. I connect to the internet through a Dlink router and
cable-modem.

When I do a Socket/TCPSocket.gethostbyname call from within ruby, for
"unknown" hosts it returns an array that corresponds to my DynDNS
domain name
with my "public IP address"

When I run `nslookup` it returns:

** server can't find foo.foobar.frt: NXDOMAIN

With the socket version it is more complicated for me to determine
bad hosts
and I certainly can't do it in a portable way, so I'd like to set
things up so
the Ruby.Socket code returns a proper error.

I'm guessing this has something to do with my (improper)
configuration of my
system or router. Any help would be appreciated

I am curious why I would get different behaviours from the Ruby
gethostbyname
and nsslookup which I would imagine should resolve down to a
gethostbyname
call as well.

Ideas?

I don't think this is a ruby issue...

$ nslookup foo.foobar.frt
Server: 192.168.1.15
Address: 192.168.1.15#53

** server can't find foo.foobar.frt: NXDOMAIN

$ ruby -rsocket -e 'Socket.gethostbyname("foo.foobar.frt")'
-e:1:in `gethostbyname': getaddrinfo: hostname nor servname provided,
or not known (SocketError)
from -e:1

Ruby uses the libc resolver to look up domain names. (I forget if
nslookup uses libc or its own builtin resolver... host does under OS X.)

Try also the pure-ruby DNS resolver:

$ ruby -rresolv -e 'p Resolv.getaddress("foo.foobar.frt")'
/usr/local/lib/ruby/1.8/resolv.rb:89:in `getaddress': no address for
foo.foobar.frt (Resolv::ResolvError)
from /usr/local/lib/ruby/1.8/resolv.rb:39:in `getaddress'
from -e:1
 
E

Eric Hodel

Apologies in advance if this is the wrong place to post,
appreciate any
pointers to the right place if I've polluted the wrong thread

Specifics:
ruby 1.8.2 (2004-12-25) [i686-linux]
Host: Linux gentoo 2.6.12

My linux box does not run a nameserver, as it is a home machine
that I use
for development. I connect to the internet through a Dlink router and
cable-modem.

When I do a Socket/TCPSocket.gethostbyname call from within ruby, for
"unknown" hosts it returns an array that corresponds to my DynDNS
domain name
with my "public IP address"

When I run `nslookup` it returns:

** server can't find foo.foobar.frt: NXDOMAIN

With the socket version it is more complicated for me to determine
bad hosts
and I certainly can't do it in a portable way, so I'd like to set
things up so
the Ruby.Socket code returns a proper error.

I'm guessing this has something to do with my (improper)
configuration of my
system or router. Any help would be appreciated

I am curious why I would get different behaviours from the Ruby
gethostbyname
and nsslookup which I would imagine should resolve down to a
gethostbyname
call as well.

Ideas?

I don't think this is a ruby issue...

$ nslookup foo.foobar.frt
Server: 192.168.1.15
Address: 192.168.1.15#53

** server can't find foo.foobar.frt: NXDOMAIN

$ ruby -rsocket -e 'Socket.gethostbyname("foo.foobar.frt")'
-e:1:in `gethostbyname': getaddrinfo: hostname nor servname
provided, or not known (SocketError)
from -e:1

Ruby uses the libc resolver to look up domain names. (I forget if
nslookup uses libc or its own builtin resolver... host does under
OS X.)

... host uses its own builtin resolver under OS X ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top