raspberrypi / rpi-imager

The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.
https://www.raspberrypi.com/software
Other
1.55k stars 233 forks source link

[BUG]: Usage of .local as domain #854

Open besendorf opened 2 months ago

besendorf commented 2 months ago

What happened?

When customizing the settings during install the imager allows setting a hostname. One cannot edit the domain and it is set to ".local". .local should not be used for internal addresses as it is reserved for mDNS (https://datatracker.ietf.org/doc/html/rfc6762). The IANA just recently reserved .internal for that purpose. I would suggest making the field editable and setting the default to .internal

Version

1.8.5 (Default)

What host operating system were you using?

Windows

Host OS Version

-

Selected OS

-

Which Raspberry Pi Device are you using?

Raspberry Pi 5

What kind of storage device are you using?

microSD Card in an internal reader

OS Customisation

Relevant log output

No response

lurch commented 2 months ago

Raspberry Pi OS doesn't actually set the "domain" part of the hostname, and it does use mDNS.

pi5@homepi5:~ $ hostname --long
homepi5
pi5@homepi5:~ $ cat /etc/hosts
127.0.0.1   localhost
::1     localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.1.1   homepi5

I believe Raspberry Pi Imager simply shows the .local part after the hostname, to illustrate to people what hostname they would need to use to access it (e.g. via SSH) from another computer, using the mDNS name.

tdewey-rpi commented 2 months ago

Thanks for the report, @besendorf.

It looks like the label, which is for informational purposes only (as @lurch has pointed out), has created some confusion here. The only change I can see that would reduce the scope for confusion is to delete the label entirely - we can't know the mDNS domain used on a deployed network, so pretending we can know is potentially harmful.

However, when I consider the majority of deployments (indeed, literally every single network I've used mDNS on), I believe the label offers a degree of useful information.

Autodetection is also inappropriate here, for the same reason as it is potentially harmful for WiFi country codes, etc - just because you're writing the SD card on a given machine; in a given locale; in a given place; does not mean that the Raspberry Pi that will execute the storage device carries the same assumptions.

I can't say I'm confident of the correct solution here. I'm not sure there even is one. I can, however, say that I don't intend to remove the label until we can offer a solution that both reduces confusion and improves accuracy for the majority of users.

I'll hold this open for at least 2 weeks from this day to allow for discourse - but if we cannot converge on a proposed replacement I will be forced to mark this issue as 'Won't Fix'.