# Putty can't connect over SSH to hostname, IP connection work

## rutherford

I have a gentoo box on my homenetwork that I'm trying to SSH into via W7 client but although I can do it via IP address when I try the hostname it won't find it. Also get a DNS error

```
socket.gaierror: [Errno -2] Name or service not known
```

when I try to startup a http server on the gentoo. I assume as this is a dns error that these issues are related.

It was working a few months ago when I last logged in so I'm not sure what's changed in the meantime?

Ping fails on supplying hostname too but again, pinging the IP works fine.

On my router firmware I have port forwarding setup and use DynDNS (no-ip.org) to connect to the linux hostname for ssh and http. When I try to connect via ssh using the external DynDNS name it works fine, indicating the router, ie DHCP server, can resolve the gentoo hostname fine. The windows7 box is said up for DHCP, as was Gentoo.

So it appears router resolves hostname but not my windows box/the linux http server itself?

Edit: I added the hostname/static ip record to my etc/hosts and now the gentoo web server starts fine, indicating name resolution was the issue. But as I've never had to do this before I'm wondering why my home network machines aren't using DHCP to look them up from the router when that's how they got their own assigned addresses?

The only change in my home network config since the last time I booted gentoo has been a new router (upgraded to BT Infinity fibre optic broadband in the last month). It had no problems with name resolution of either the windows 7 or gentoo machines and DHCP address assignment appeared to 'just work' as it should.

----------

## BonezTheGoon

Sounds to me like the new router you mentioned that you bought might not be configuring your DHCP clients with the router as a DNS server, and instead it is just passing your ISP DNS servers on to your LAN DHCP clients.  The result is that your LAN clients cannot resolve one another, but anything outbound on the internet still resolves.  You should be able to check this pretty easily.

----------

## rutherford

Had a quick Google and apparently it's not possible to change DNS settings on BT Home Hub 3 (my router). Static IPs though so I guess only option is to set hostfiles manually.

----------

