Custom domain name for Pi server

January 10, 2025, 03:31

jeremymuller

I have an art project where I'm running a Nodejs server on a Raspberry Pi 4, I have that connected to a local router (no internet access) via ethernet cable to create a WLAN. I have several mobile devices I connect to the router and then to the server in a browser because I know the IP address. Is there a way to make a custom domain name on the Pi so I don't have to remember 192.blah.blah.blah? And I'm not worried about conflicts with websites on the internet since this is a local network with no internet access. I assume there's some conf file I need to edit? Thanks for any help

k9t33n

What is it your accessing via this IP?

jeremymuller

Just a website

jeremymuller

Can anyone help? Or point me in the right direction? Thanks

k9t33n

oop forgot about this

k9t33n

you can do this in the webstie configuration but its probably just easier to remember your pis ip. that will come in use anyway if you want to ssh

oops.se

You need to do that in the routers DNS server. Or if your mobile devices support mDNS then they should be able to reach your web via the Raspberry pis hostname.local, example: raspberrypi.local

jeremymuller

So this isn't necessarily a Pi configuration but more of configuring my router to recognize the IP with a domain name?

oops.se

Either you go : 1. Either use the domain name that exists in your router or create a new one. And then you can add a hostname -> IP for each host you need a resolution to. 2. Do nothing on the router and use the existing mDNS feature in your Raspberry Pi OS. The mDNS feature will send out broadcast on your local network that other clients can pick up and then they (clients) can reach the Raspberry Pi with a FQDN (hostname.local).

oops.se

So you could try method 2 first as it doesnt need any configuration.