3

I have no idea where to begin or where to look for this, so I'm hoping to get pointed in the right direction.

I've built a Raspberry Pi 4 that has a web server on it. It spins up a WiFi network using hostapd. Users connect to the network and navigate to the website running on it.

Right now, users can connect by IP address but the server's name doesn't resolve. For example, I connect to network with my iPhone. I want to navigate to web server on the Pi via http://webserver.

What is a good way to acheive this? A DNS server? DHCP? Something else?

RoninEngineer
  • 111
  • 2
  • 2
  • 6
amber
  • 153
  • 7

1 Answers1

4

Your question is imprecise, but assuming it is How to Connect a Computer to the Pi the following may help.

Use hostname.local

See Connecting a Computer to the Pi in Pi Networking

NOTE the caveats; .local resolution is NOT Pi specific (mDNS is an IETF standard - see https://en.wikipedia.org/wiki/.local) and impacted by networking caching, but should work 99% of the time. (When it doesn't restarting routers and client computers refreshes caches.)

If you don't want to use .local you will need to implement a DNS and configure all users to use your local DNS.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • This answer was good in that it gave me the language I needed to go find the answer I needed, which was dnsmasq--which I already had on the Pi--and got me in the direction I needed. Thank you! – amber Dec 19 '22 at 14:14
  • The answer from Milliways say mDNS that's totally different from dnsmasq. – MatsK Jan 03 '23 at 20:54