So I've installed pi-hole in my debian 10 server. Everything good but my router can't resolve the server hostname. On my router connected devices the server doesn't have its hostname (debianserver) but "computer" and now is "computer-2". I think my router give it a standard name because it can't find the hostname. I can't disable DHCP on my router so pi-hole is not doing DHCP server. I set static ip 192.168.1.100 and this are the outputs
/etc/dhcpcd.conf
interface enp3s0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1
/etc/hostname
debianserver
/etc/hosts
127.0.0.1 localhost
192.168.1.100 debianserver
I can get to pi-hole admin page using 192.168.1.100/admin from other computers, but I would like to know what is the problem because it's all day that I'm trying and I'm learning linux.
Thanks
EDIT
So I changed /etc/network/interfaces from
iface enp3s0 inet static
address 192.168.1.100/24
gateway 192.168.1.1
hostname debianserver
to
iface enp3s0 inet dhcp
Now "debianserver" is back on thr router connected devices page but I can't reach any site on my macbook using pihole ip.
I switched back to static and now everything is working, debianserver is still in the router connected devices page and I can connect to pihole admin page using server/admin on my macbook.
Anyway I will add an entry to /etc/hosts on my macbook so I'm sure I will always reach "debianserver".
I don't understand if the static ip is set using /etc/dhcpcd.conf or /etc/network/interfaces.
Linux is complicated