> curl -v http://foo.private
* Trying 127.0.0.1:80...
* connect to 127.0.0.1 port 80 failed: Connection refused
* Failed to connect to foo.private port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to foo.private port 80: Connection refused
Thanks RagnarOlafsson! I forgot that nslookup doesn't query the /etc/hosts file. That was what was tripping me up.
]]>You can test whether the translation is working by pinging the name or just navigating to the hostname in your web browser.
]]>nslookup says it asked server 75.75.75.75. This means the 75.75.75.75 machine tried to find "foo.private". The 75.75.75.75 machine can't know what's happening in your /etc/hosts file.
]]>Here is my /etc/hosts file
```
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost
::1 localhost
127.0.1.1 archlinux.host.local
127.0.0.1 foo.private
```
/etc/resolv.conf
```
# Generated by NetworkManager
search hsd1.co.comcast.net host.local
nameserver 75.75.75.75
nameserver 75.75.76.76
nameserver 2001:558:feed::1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 2001:558:feed::2
```
And /etc/nsswitch.conf
```
# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.
passwd: files systemd
group: files systemd
shadow: files
publickey: files
hosts: files mymachines myhostname resolve [!UNAVAIL=return] dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
netgroup: files
```
Here is the output of the nslookup query
```
> nslookup foo.private
Server: 75.75.75.75
Address: 75.75.75.75#53
** server can't find foo.private: NXDOMAIN
```
I'm confused - what I've been able to find so far tells me that the /etc/nsswitch.conf should try "file" first for hosts.
All the relevant files (I think) have correct permission:
```
> ls -ahl /etc | grep -E 'hosts|nsswitch|resolv'
-rw-r--r-- 1 root root 554 Jan 13 08:21 hosts
-rw-r--r-- 1 root root 312 Sep 2 16:30 nsswitch.conf
-rw-r--r-- 1 root root 291 Jan 13 08:02 resolv.conf
```
I'm at a bit of a loss as to where to start digging into this. Does anyone have any tips?
]]>