Router providing client name addressing

I have a local network consisting of multiple Pi’s and win computers all connected exclusively with ethernet cables and simple switches. I had a comsec 4G modem router and when this was supporting my internet access for the network I was able to ping and ssh into any machine from any other machine on the local network. For instance a pi at address 192.168.1.62 with corresponding client name testtube2-1y. I was able to:
ping 192.168.1.62
and also I was able to:
ping testtube2-1y
Similar for ssh.
I have sent modem away - now I have connected this same network to my NBN connection and I can ping any device using the ip address but it does not work for ping the client name.
I am just trialing a starlink system and it does not work either.
Why is this hapening - how can I fix it?
I have looked in the routers client table and it has the correct client name corresponding with the ip address.
I need to be able to use the client name.

2 Likes

Hi Clem,

It sounds like you are after a local DNS server, I’d check out PiHole as it offers a lot of other services that can be handy!

1 Like

Hi Liam,

I like your PiHole suggestion, I have been viewing video after video about PiHole. Mostly used to setup add removal etc. I am not clear yet how to set up to just add local hostname IP resolution to the network. I want it to automatically detect hostename with IP address and provide the local IP resolution so that I can ping and ssh into local hosts using the hoste name. Any suggestions to links to provide this information clearly?

1 Like

Hi Clem,

I couldnt find any notes on that particular application as it might be a bit niche, here’s a quick guide on the DNS server portion of PiHole: Using Pi-Hole for Local DNS - Fast, Simple, and Easy Guide - YouTube

It sounds like a python script might be able to build this config file.
And did find this forum topic for a similar problem after searching ‘map hostname to ip’: networking - Hostname mapping to LAN IPs in Router? - Super User

2 Likes

Many years ago (20+), I did courses on configuring IP networks. So this may not be up to date. Converting names to IP addresses has two methods, a hosts file on the machine doing the lookup, or a request to a DNS server. Hosts files are rarely used (but useful when all else fails). It is common for routers to provide DNS services, to act as a relay between the local network and external DNS (which the router either knows or finds out from the ISP via DHCP). To provide local network translation of names to IP addresses, the router DNS needs to be updated. This is usually done by the DHCP server (which is also a service on the router). The sequence (simplified) is [machine requests an IP address from a DHCP server] [DHCP server provides IP address, also collects name from requesting machine] [DHCP updates DNS with the IP address it handed out and the name the machine provided].
This process is often not well documented when reading router manuals. To figure out how your network is failing, start with the device providing DHCP services. There may be configuration required for the DHCP server to update the DNS server. ipconfig will tell where DNS and DHCP services are coming from. If the DNS server provided to machines is the ISP DNS then it won’t be updated by the local DHCP, it requires a local DNS server.
Hope this (a) makes sense (b) is helpful.

3 Likes

Clem,
not sure if you’ve solved this yet, but two simple commands you could try:
On a PC, use ipconfig /all and look for DNS Servers, which should be your Router (which will show as Default Gateway)

On a Pi, just cat the resolve.conf file ( cat /etc/resolv.conf), and look for your router IP (nameserver 192.168.1.1 or similar.

Dave

1 Like