1 |
On 07/08/2011 11:58 AM, Grant wrote: |
2 |
>>> I'm not able to ssh to any domain, although IPs work. I get: |
3 |
>>> |
4 |
>>> $ ssh example.com |
5 |
>>> ssh: Could not resolve hostname example.com: Name or service not known |
6 |
>>> |
7 |
>>> I can ping domains no problem, and web browsing works. I've tried |
8 |
>>> rebooting and re-emerging openssh. I am connected to an unfamiliar |
9 |
>>> wireless network (with no alternative right now) but I could ssh to |
10 |
>>> domains no problem over this network before. Does this make sense to |
11 |
>>> anyone? |
12 |
>> |
13 |
>> It does not :) |
14 |
>> |
15 |
>> So, if you do: |
16 |
>> |
17 |
>> host example.com |
18 |
>> |
19 |
>> it shows the correct IP address? |
20 |
> |
21 |
> I get: |
22 |
> |
23 |
> $ host google.com |
24 |
> google.com has address 74.125.224.83 |
25 |
|
26 |
> $ ssh google.com |
27 |
> ssh: Could not resolve hostname google.com: Name or service not known |
28 |
|
29 |
When I do ssh google.com the process hangs until I kill it, but it does |
30 |
find the right IP address. Along the way it checks /etc/gai.conf, which |
31 |
is installed by glibc and is used by the getaddrinfo(3) system call. |
32 |
|
33 |
My gai.conf has only three uncommented lines: |
34 |
|
35 |
scopev4 ::ffff:169.254.0.0/112 2 |
36 |
scopev4 ::ffff:127.0.0.0/104 2 |
37 |
scopev4 ::ffff:0.0.0.0/96 14 |
38 |
|
39 |
Of course, lots of other files are consulted, as already mentioned in |
40 |
this thread. I mention gai.conf only because I'd never heard of it |
41 |
until I ran strace on ssh just now. |