public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] DNS error with ssh
@ 2011-07-07 22:29 Grant
  2011-07-07 23:10 ` Paul Hartman
  2011-07-08  1:42 ` [gentoo-user] " Alex Schuster
  0 siblings, 2 replies; 20+ messages in thread
From: Grant @ 2011-07-07 22:29 UTC (permalink / raw
  To: Gentoo mailing list

I'm not able to ssh to any domain, although IPs work.  I get:

$ ssh example.com
ssh: Could not resolve hostname example.com: Name or service not known

I can ping domains no problem, and web browsing works.  I've tried
rebooting and re-emerging openssh.  I am connected to an unfamiliar
wireless network (with no alternative right now) but I could ssh to
domains no problem over this network before.  Does this make sense to
anyone?

- Grant



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-07 22:29 [gentoo-user] DNS error with ssh Grant
@ 2011-07-07 23:10 ` Paul Hartman
  2011-07-08  0:36   ` Adam Carter
                     ` (2 more replies)
  2011-07-08  1:42 ` [gentoo-user] " Alex Schuster
  1 sibling, 3 replies; 20+ messages in thread
From: Paul Hartman @ 2011-07-07 23:10 UTC (permalink / raw
  To: gentoo-user

On Thu, Jul 7, 2011 at 5:29 PM, Grant <emailgrant@gmail.com> wrote:
> I'm not able to ssh to any domain, although IPs work.  I get:
>
> $ ssh example.com
> ssh: Could not resolve hostname example.com: Name or service not known
>
> I can ping domains no problem, and web browsing works.  I've tried
> rebooting and re-emerging openssh.  I am connected to an unfamiliar
> wireless network (with no alternative right now) but I could ssh to
> domains no problem over this network before.  Does this make sense to
> anyone?

It does not :)

So, if you do:

host example.com

it shows the correct IP address?

If you ssh to that IP address, it works?

Nothing related to this hostname is in your /etc/hosts is it? Does
your /etc/resolv.conf look okay to you?

Weird...



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-07 23:10 ` Paul Hartman
@ 2011-07-08  0:36   ` Adam Carter
  2011-07-08  0:43   ` Grant
  2011-07-08 18:58   ` Grant
  2 siblings, 0 replies; 20+ messages in thread
From: Adam Carter @ 2011-07-08  0:36 UTC (permalink / raw
  To: gentoo-user

> It does not :)

Agreed. Both ping <hostname> and ssh <hostname> should either both
work or both fail - assuming of course you are trying to ping the same
host that you're trying to ssh to.

You could try using an alternate DNS server, like google public ones
8.8.8.8 and 8.8.4.4. DHCP will have automatically updated your
/etc/resolv.conf but you can still edit it. Just remember it will be
overwritten again the next time you connect.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-07 23:10 ` Paul Hartman
  2011-07-08  0:36   ` Adam Carter
@ 2011-07-08  0:43   ` Grant
  2011-07-08  1:25     ` Adam Carter
  2011-07-08  1:36     ` Albert Hopkins
  2011-07-08 18:58   ` Grant
  2 siblings, 2 replies; 20+ messages in thread
From: Grant @ 2011-07-08  0:43 UTC (permalink / raw
  To: gentoo-user

>> I'm not able to ssh to any domain, although IPs work.  I get:
>>
>> $ ssh example.com
>> ssh: Could not resolve hostname example.com: Name or service not known
>>
>> I can ping domains no problem, and web browsing works.  I've tried
>> rebooting and re-emerging openssh.  I am connected to an unfamiliar
>> wireless network (with no alternative right now) but I could ssh to
>> domains no problem over this network before.  Does this make sense to
>> anyone?
>
> It does not :)
>
> So, if you do:
>
> host example.com

I'm not sure which package that is.

> it shows the correct IP address?
>
> If you ssh to that IP address, it works?

Yes, that works.

> Nothing related to this hostname is in your /etc/hosts is it? Does
> your /etc/resolv.conf look okay to you?

/etc/hosts only has my 127.0.0.1 entry.  /etc/resolv.conf looked fine
with a domain entry and a nameserver entry but I removed both and
added Google's nameserver at 8.8.8.8 and it works.

> Weird...

Yeah I don't get it.  Check this out:

$ ping google.com
PING google.com (74.125.224.84) 56(84) bytes of data.
64 bytes from 74.125.224.84: icmp_req=1 ttl=55 time=97.1 ms
64 bytes from 74.125.224.84: icmp_req=2 ttl=55 time=97.1 ms
64 bytes from 74.125.224.84: icmp_req=3 ttl=55 time=97.5 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 5142ms
rtt min/avg/max/mdev = 97.105/97.268/97.539/0.319 ms
$ ssh google.com
ssh: Could not resolve hostname google.com: Name or service not known

- Grant



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08  0:43   ` Grant
@ 2011-07-08  1:25     ` Adam Carter
  2011-07-08  1:36     ` Albert Hopkins
  1 sibling, 0 replies; 20+ messages in thread
From: Adam Carter @ 2011-07-08  1:25 UTC (permalink / raw
  To: gentoo-user

>> host example.com
>
> I'm not sure which package that is.

Its in bind-tools, which also has nslookup.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08  0:43   ` Grant
  2011-07-08  1:25     ` Adam Carter
@ 2011-07-08  1:36     ` Albert Hopkins
  1 sibling, 0 replies; 20+ messages in thread
From: Albert Hopkins @ 2011-07-08  1:36 UTC (permalink / raw
  To: gentoo-user



On Thursday, July 7 at 17:43 (-0700), Grant said:


> 
> Yeah I don't get it.  Check this out:
> 
> $ ping google.com
> PING google.com (74.125.224.84) 56(84) bytes of data.
> 64 bytes from 74.125.224.84: icmp_req=1 ttl=55 time=97.1 ms
> 64 bytes from 74.125.224.84: icmp_req=2 ttl=55 time=97.1 ms
> 64 bytes from 74.125.224.84: icmp_req=3 ttl=55 time=97.5 ms
> ^C
> --- google.com ping statistics ---
> 3 packets transmitted, 3 received, 0% packet loss, time 5142ms
> rtt min/avg/max/mdev = 97.105/97.268/97.539/0.319 ms
> $ ssh google.com
> ssh: Could not resolve hostname google.com: Name or service not known
> 
> - Grant
> 

Check your ~/.ssh/config.  For example:

$ ssh localhost # works fine, but

$ mv ~/.ssh/config ~/.ssh/config.bak

$ cat -v config.test
Host *
    HostName "%h ^H"

$ mv config.test ~/.ssh/config

$ ssh localhost
ssh: Could not resolve hostname localhost: Name or service not known





^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-07 22:29 [gentoo-user] DNS error with ssh Grant
  2011-07-07 23:10 ` Paul Hartman
@ 2011-07-08  1:42 ` Alex Schuster
  2011-07-08  1:50   ` Adam Carter
  2011-07-08 18:57   ` Grant
  1 sibling, 2 replies; 20+ messages in thread
From: Alex Schuster @ 2011-07-08  1:42 UTC (permalink / raw
  To: gentoo-user

Grant writes:

> I'm not able to ssh to any domain, although IPs work.  I get:
> 
> $ ssh example.com
> ssh: Could not resolve hostname example.com: Name or service not known
> 
> I can ping domains no problem, and web browsing works.  I've tried
> rebooting and re-emerging openssh.  I am connected to an unfamiliar
> wireless network (with no alternative right now) but I could ssh to
> domains no problem over this network before.  Does this make sense to
> anyone?

I'd compare the output of strace ping <host> and strace ssh <host>. Anything 
in nsswitch.conf? It seems to be used by ssh, but not by the host command. 
Which is new to me.

Any recent changes in ~/.ssh/config or /etc/ssh/ssh_config?

Normally I'd say this just can't happen...

	Wonko



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08  1:42 ` [gentoo-user] " Alex Schuster
@ 2011-07-08  1:50   ` Adam Carter
  2011-07-08 18:57   ` Grant
  1 sibling, 0 replies; 20+ messages in thread
From: Adam Carter @ 2011-07-08  1:50 UTC (permalink / raw
  To: gentoo-user

> I'd compare the output of strace ping <host> and strace ssh <host>. Anything
> in nsswitch.conf? It seems to be used by ssh, but not by the host command.
> Which is new to me.

IIRC nslookup also only uses DNS servers, not the nsswitch.conf lookup
option list. Since the ns probably stands for name server, that makes
sense.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08  1:42 ` [gentoo-user] " Alex Schuster
  2011-07-08  1:50   ` Adam Carter
@ 2011-07-08 18:57   ` Grant
  2011-07-08 20:16     ` Alex Schuster
  1 sibling, 1 reply; 20+ messages in thread
From: Grant @ 2011-07-08 18:57 UTC (permalink / raw
  To: gentoo-user

>> I'm not able to ssh to any domain, although IPs work.  I get:
>>
>> $ ssh example.com
>> ssh: Could not resolve hostname example.com: Name or service not known
>>
>> I can ping domains no problem, and web browsing works.  I've tried
>> rebooting and re-emerging openssh.  I am connected to an unfamiliar
>> wireless network (with no alternative right now) but I could ssh to
>> domains no problem over this network before.  Does this make sense to
>> anyone?
>
> I'd compare the output of strace ping <host> and strace ssh <host>. Anything
> in nsswitch.conf? It seems to be used by ssh, but not by the host command.
> Which is new to me.

nsswitch.conf looks straighforward and should be default.  I get a lot
of output from those straces.  Can you tell me what to look for?

> Any recent changes in ~/.ssh/config or /etc/ssh/ssh_config?

~/.ssh/config doesn't exist and /etc/ssh/ssh_config is all commented out.

> Normally I'd say this just can't happen...

If I remove the domain and nameserver declarations in /etc/resolv.conf
and add 'nameserver 8.8.8.8', it works properly.  Is this something I
should investigate, or more of a "don't worry about it" situation?  I
should be off of this wireless network very soon.

- Grant



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-07 23:10 ` Paul Hartman
  2011-07-08  0:36   ` Adam Carter
  2011-07-08  0:43   ` Grant
@ 2011-07-08 18:58   ` Grant
  2011-07-08 22:35     ` Peter Ruskin
  2011-07-09  0:16     ` [gentoo-user] " walt
  2 siblings, 2 replies; 20+ messages in thread
From: Grant @ 2011-07-08 18:58 UTC (permalink / raw
  To: gentoo-user

>> I'm not able to ssh to any domain, although IPs work.  I get:
>>
>> $ ssh example.com
>> ssh: Could not resolve hostname example.com: Name or service not known
>>
>> I can ping domains no problem, and web browsing works.  I've tried
>> rebooting and re-emerging openssh.  I am connected to an unfamiliar
>> wireless network (with no alternative right now) but I could ssh to
>> domains no problem over this network before.  Does this make sense to
>> anyone?
>
> It does not :)
>
> So, if you do:
>
> host example.com
>
> it shows the correct IP address?

I get:

$ host google.com
google.com has address 74.125.224.83
google.com has address 74.125.224.84
google.com has address 74.125.224.80
google.com has address 74.125.224.81
google.com has address 74.125.224.82
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
$ ssh google.com
ssh: Could not resolve hostname google.com: Name or service not known

- Grant



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 18:57   ` Grant
@ 2011-07-08 20:16     ` Alex Schuster
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Schuster @ 2011-07-08 20:16 UTC (permalink / raw
  To: gentoo-user

Grant writes:

> > Anything in nsswitch.conf? It seems to be used by ssh, but not by the
> > host command. Which is new to me.
> 
> nsswitch.conf looks straighforward and should be default.  I get a lot
> of output from those straces.  Can you tell me what to look for?

For 'strange' things :)  Like config files being opened, which you could 
investigate.

	Wonko



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 18:58   ` Grant
@ 2011-07-08 22:35     ` Peter Ruskin
  2011-07-08 23:12       ` Mick
                         ` (4 more replies)
  2011-07-09  0:16     ` [gentoo-user] " walt
  1 sibling, 5 replies; 20+ messages in thread
From: Peter Ruskin @ 2011-07-08 22:35 UTC (permalink / raw
  To: gentoo-user

On Friday 08 July 2011 19:58:47 Grant wrote:
> > host example.com
> >
What package provides host?
I'm amazed I don't have it.

-- 
Peter
========================================================================
Gentoo Linux: Portage 2.2.0_alpha28		kernel-2.6.38-gentoo-r2
AMD Phenom(tm) 9950 Quad-Core Processor		gcc(Gentoo: 4.5.2)
KDE: 3.5.10					Qt: 3.3.8b
========================================================================



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 22:35     ` Peter Ruskin
@ 2011-07-08 23:12       ` Mick
  2011-07-09  8:13         ` Peter Ruskin
  2011-07-08 23:15       ` Alex Schuster
                         ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Mick @ 2011-07-08 23:12 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 233 bytes --]

On Friday 08 Jul 2011 23:35:21 Peter Ruskin wrote:
> On Friday 08 July 2011 19:58:47 Grant wrote:
> > > host example.com
> 
> What package provides host?
> I'm amazed I don't have it.

net-dns/bind-tools
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 22:35     ` Peter Ruskin
  2011-07-08 23:12       ` Mick
@ 2011-07-08 23:15       ` Alex Schuster
  2011-07-08 23:47       ` [gentoo-user] " walt
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Alex Schuster @ 2011-07-08 23:15 UTC (permalink / raw
  To: gentoo-user

Peter Ruskin writes:

> What package provides host?
> I'm amazed I don't have it.

net-dns/bind-tools

	Wonko



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [gentoo-user] Re: DNS error with ssh
  2011-07-08 22:35     ` Peter Ruskin
  2011-07-08 23:12       ` Mick
  2011-07-08 23:15       ` Alex Schuster
@ 2011-07-08 23:47       ` walt
  2011-07-08 23:55       ` [gentoo-user] " Paul Hartman
  2011-07-09  3:04       ` Thanasis
  4 siblings, 0 replies; 20+ messages in thread
From: walt @ 2011-07-08 23:47 UTC (permalink / raw
  To: gentoo-user

On 07/08/2011 03:35 PM, Peter Ruskin wrote:
> On Friday 08 July 2011 19:58:47 Grant wrote:
>>> host example.com
>>>
> What package provides host?
> I'm amazed I don't have it.

net-dns/bind-tools





^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 22:35     ` Peter Ruskin
                         ` (2 preceding siblings ...)
  2011-07-08 23:47       ` [gentoo-user] " walt
@ 2011-07-08 23:55       ` Paul Hartman
  2011-07-09  3:04       ` Thanasis
  4 siblings, 0 replies; 20+ messages in thread
From: Paul Hartman @ 2011-07-08 23:55 UTC (permalink / raw
  To: gentoo-user

On Fri, Jul 8, 2011 at 5:35 PM, Peter Ruskin <peter.ruskin@dsl.pipex.com> wrote:
> On Friday 08 July 2011 19:58:47 Grant wrote:
>> > host example.com
>> >
> What package provides host?
> I'm amazed I don't have it.

net-dns/bind-tools

it contains these basic essentials :)

/usr/bin/dig
/usr/bin/dnssec-keygen
/usr/bin/host
/usr/bin/nslookup
/usr/bin/nsupdate



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [gentoo-user] Re: DNS error with ssh
  2011-07-08 18:58   ` Grant
  2011-07-08 22:35     ` Peter Ruskin
@ 2011-07-09  0:16     ` walt
  2011-07-09  6:09       ` Adam Carter
  1 sibling, 1 reply; 20+ messages in thread
From: walt @ 2011-07-09  0:16 UTC (permalink / raw
  To: gentoo-user

On 07/08/2011 11:58 AM, Grant wrote:
>>> I'm not able to ssh to any domain, although IPs work.  I get:
>>>
>>> $ ssh example.com
>>> ssh: Could not resolve hostname example.com: Name or service not known
>>>
>>> I can ping domains no problem, and web browsing works.  I've tried
>>> rebooting and re-emerging openssh.  I am connected to an unfamiliar
>>> wireless network (with no alternative right now) but I could ssh to
>>> domains no problem over this network before.  Does this make sense to
>>> anyone?
>>
>> It does not :)
>>
>> So, if you do:
>>
>> host example.com
>>
>> it shows the correct IP address?
> 
> I get:
> 
> $ host google.com
> google.com has address 74.125.224.83

> $ ssh google.com
> ssh: Could not resolve hostname google.com: Name or service not known

When I do ssh google.com the process hangs until I kill it, but it does
find the right IP address.  Along the way it checks /etc/gai.conf, which
is installed by glibc and is used by the getaddrinfo(3) system call.

My gai.conf has only three uncommented lines:

scopev4 ::ffff:169.254.0.0/112  2
scopev4 ::ffff:127.0.0.0/104    2
scopev4 ::ffff:0.0.0.0/96       14

Of course, lots of other files are consulted, as already mentioned in
this thread.  I mention gai.conf only because I'd never heard of it
until I ran strace on ssh just now.







^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 22:35     ` Peter Ruskin
                         ` (3 preceding siblings ...)
  2011-07-08 23:55       ` [gentoo-user] " Paul Hartman
@ 2011-07-09  3:04       ` Thanasis
  4 siblings, 0 replies; 20+ messages in thread
From: Thanasis @ 2011-07-09  3:04 UTC (permalink / raw
  To: gentoo-user

on 07/09/2011 01:35 AM Peter Ruskin wrote the following:
> On Friday 08 July 2011 19:58:47 Grant wrote:
>>> host example.com
>>>
> What package provides host?
> I'm amazed I don't have it.
> 

net-dns/bind-tools



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] Re: DNS error with ssh
  2011-07-09  0:16     ` [gentoo-user] " walt
@ 2011-07-09  6:09       ` Adam Carter
  0 siblings, 0 replies; 20+ messages in thread
From: Adam Carter @ 2011-07-09  6:09 UTC (permalink / raw
  To: gentoo-user

> When I do ssh google.com the process hangs until I kill it,

Its probably just retrying..
adam@sphinx ~ $ cat /proc/sys/net/ipv4/tcp_syn_retries
5

...five times because google's firewall is dropping it (so not
resetting the connection), and IIRC the timeout at each retry
increases (doubles?) so it takes a long time.

> but it does
> find the right IP address.  Along the way it checks /etc/gai.conf, which
> is installed by glibc and is used by the getaddrinfo(3) system call.
>
> My gai.conf has only three uncommented lines:
>
> scopev4 ::ffff:169.254.0.0/112  2
> scopev4 ::ffff:127.0.0.0/104    2
> scopev4 ::ffff:0.0.0.0/96       14
>
> Of course, lots of other files are consulted, as already mentioned in
> this thread.  I mention gai.conf only because I'd never heard of it
> until I ran strace on ssh just now.

Never heard of that file either. Interestingly ping and host dont seem
to read it.
adam@sphinx ~ $ strace ping google.com 2>&1 | grep gai.conf
adam@sphinx ~ $ strace host google.com 2>&1 | grep gai.conf
adam@sphinx ~ $ strace ssh google.com 2>&1 | grep gai.conf
open("/etc/gai.conf", O_RDONLY)         = 3
^C

And that's because they're not using getaddrinfo (if grepping strace
output is a valid test....)

It makes sense that host wouldn't use it, and it is supposed to just
use DNS not query through the resolution options listed in
nsswtich.conf. I have NFI why ping isnt using it....



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-user] DNS error with ssh
  2011-07-08 23:12       ` Mick
@ 2011-07-09  8:13         ` Peter Ruskin
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Ruskin @ 2011-07-09  8:13 UTC (permalink / raw
  To: gentoo-user

On Saturday 09 July 2011 00:12:55 Mick wrote:
> On Friday 08 Jul 2011 23:35:21 Peter Ruskin wrote:
> > On Friday 08 July 2011 19:58:47 Grant wrote:
> > > > host example.com
> >
> > What package provides host?
> > I'm amazed I don't have it.
>
> net-dns/bind-tools

Thanks, all of you.

-- 
Peter
========================================================================
Gentoo Linux: Portage 2.2.0_alpha28		kernel-2.6.38-gentoo-r2
AMD Phenom(tm) 9950 Quad-Core Processor		gcc(Gentoo: 4.5.2)
KDE: 3.5.10					Qt: 3.3.8b
========================================================================



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-07-09  9:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 22:29 [gentoo-user] DNS error with ssh Grant
2011-07-07 23:10 ` Paul Hartman
2011-07-08  0:36   ` Adam Carter
2011-07-08  0:43   ` Grant
2011-07-08  1:25     ` Adam Carter
2011-07-08  1:36     ` Albert Hopkins
2011-07-08 18:58   ` Grant
2011-07-08 22:35     ` Peter Ruskin
2011-07-08 23:12       ` Mick
2011-07-09  8:13         ` Peter Ruskin
2011-07-08 23:15       ` Alex Schuster
2011-07-08 23:47       ` [gentoo-user] " walt
2011-07-08 23:55       ` [gentoo-user] " Paul Hartman
2011-07-09  3:04       ` Thanasis
2011-07-09  0:16     ` [gentoo-user] " walt
2011-07-09  6:09       ` Adam Carter
2011-07-08  1:42 ` [gentoo-user] " Alex Schuster
2011-07-08  1:50   ` Adam Carter
2011-07-08 18:57   ` Grant
2011-07-08 20:16     ` Alex Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox