Score:0

mdns hostname not fixed

kr flag

I have a host that I named "betelgeuze". As such it is listed in /etc/hostname.

Avahi is mangling this:

boss@betelgeuze:/etc$ ps -ef |grep avahi
avahi        639       1  0 13:03 ?        00:00:02 avahi-daemon: running [betelgeuze-3.local]
avahi        682     639  0 13:03 ?        00:00:00 avahi-daemon: chroot helper
boss        5263    3210  0 13:26 pts/1    00:00:00 grep --color=auto avahi

This way I cannot assume up front my host will be accessible through the name I expect (betelgeuze.local), because it is modified to betelgeuze-3.local.

Can I force it to betelgeuze.local in any way? I know (in concept) that the name presentation may change if duplicate names are suspected on the LAN, but all I need is a way that I can force the name to be changed back to the form I want it to.

Thanks, Leo

Score:0
in flag

Try configuring your /etc/avahi/avahi-daemon.conf file so that it has a line:

host-name=betelgeuze

It will probably have

#host-name=foo

by default. Make sure you remove the # at the beginning of the line and reboot for the change to become effective.

Unbeliever avatar
kr flag
thanks for your answer. Could you help me understand how the avahi service will use this to prevent modification?
PonJar avatar
in flag
@Unbeliever, I don’t know for sure that this change will prevent modification, however it makes sense to specify it explicitly for this machine. Nothing to lose by trying it.
Unbeliever avatar
kr flag
roger dat. As long as there's no state change in the device like activation of a second interface (like firing up wifi) it should stay stable. As a precaution though I've added a cronjob that restarts avahi-deamon every day. That also seems to bring it to the configured name in /etc/hostname
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.