I'm trying to make an easy headless install image using this -> https://github.com/nmcclain/raspberian-firstboot
I've included
raspi-config nonint do_hostname myhostname
in the firstboot.sh
script.
It does change the hostname on the Pi, but in my router when I look at the client list it still shows up as "raspberrypi", even after I reboot the pi, restart networking, etc. I had this pi previously assigned to a static IP from the router but I've removed the entry and disabled the manual assignment. My router is ASUS RT-AC1200. I'm starting to think the problem is in my router like there's some sort of cache or something that keeps assigning the "old" hostname because:
hostname
returns myhostname
- In
etc/hostname
I have "myhostname", nothing else. - In
etc/hosts
I have "127.0.1.1 myhostname" as the last line. - I've tried to install Samba as someone suggested that on a StackExchange thread I found. That didn't work.
- I've also tried to include numerous other commands (that I do not remember anymore), none of them worked. I've also tried another method of executing code on first boot -> https://gitlab.com/JimDanner/pi-boot-script/tree/master, but it caused a kernel panic.
I've been at this for like 6 hours today and a couple yesterday. I would really appreciate some help.
avahi
at some point, which probably how the router got the hostname initially. – goldilocks Jan 12 '20 at 16:21