Using the guide found at http://imti.co/post/145442415333/raspberry-pi-3-wifi-station-ap, I have a successfully working AP that is also connected to my home wifi, and passes thru internet -- I'm connected to the Pi right now, not my home wifi.

However, I can't utilize it's hostname to connect (ssh, nginx/web, etc), I must use the IP address.

I've tried restarting avahi daemon.

Pi has hostname altoid.

If I do host altoid from my local (connected) machine, I get

Can I preserve this setup, and instead have it resolve to the IP I am using for ssh, etc?

EDIT: Adding file contents

/etc/hosts   localhost
::1     localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters   altoid


# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
auto eth0
auto wlan0
auto uap0

iface lo inet loopback

iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface uap0 inet static




ssid=Inconspicuous Rock
  • The Pi is getting an IP from my home wifi. Ideally, the altoid name would point at that IP address. Currently that's, which is what I use to ssh to the Pi, ping it, etc. Jun 9 '17 at 15:06
  • Hark! It looks like I was able to see a response from altoid.local. It didn't appear to be working last night, so I am going to see if I can consistently repro, either way. Jun 9 '17 at 15:18
  • I was not -- but discovered something. My avahi-daemon service is not starting on boot. After manually starting it, I am able to access the Pi via altoid.local. Jun 9 '17 at 15:51

You may have been able to use the hostname, before enabling host AP mode, because you had the DHCPv4 client running that was registering withnyour LAN's default gateway that may also be running a DHCP and DNS proxy server. Now that you've disabled dhcpcd, your Pi doesn't get registered anymore with its name. A lot of platforms and applications only use DNS, but not mDNS (avahi), unless explicitly enabled.


When you troobleshoot your hostname, you must check some points :

  • cat /etc/hostname should show your hostname.

  • In /etc/samba/smb.conf file (if you use samba), netbios name should also point to your hostname.

You must also check that your hostname doen'nt contain invalid characters. Try to use one with only alphanumerics characters.

You may also try these commands, made for live hostname edition :

echo "Hostname">/etc/hostname
sudo hostname "MyHostname"
sudo /etc/init.d/networking restart
sudo systemctl daemon-reload
sudo /etc/init.d/samba restart
  • cat /etc/hostname correctly returns altoid. Jun 9 '17 at 14:44
  • To my knowledge, I don't use Samba. Haven't configured it, or touched it, and otherwise this is a new Pi Zero W. Jun 9 '17 at 14:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.