Skip to content

Commit

Permalink
Use systemd-resolved to announce hostname via mDNS and LLMNR (#986)
Browse files Browse the repository at this point in the history
Drop AVAHI and use systemd-resolved to announce hostname via mDNS
and LLMNR. Also continue to offer the _workstation._tcp.local service
since it is used by the CoreDNS mDNS plug-in.
  • Loading branch information
agners authored Nov 13, 2020
1 parent 50d304d commit 25a0dd3
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 104 deletions.
7 changes: 1 addition & 6 deletions buildroot-external/configs/intel_nuc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -78,7 +73,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/odroid_c2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
Expand All @@ -69,7 +64,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/odroid_c4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
Expand All @@ -69,7 +64,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/odroid_n2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
Expand All @@ -69,7 +64,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/odroid_xu4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
Expand All @@ -71,7 +66,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/ova_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -69,7 +64,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi0_w_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -72,7 +67,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -71,7 +66,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi3_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -72,7 +67,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -72,7 +67,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi4_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -73,7 +68,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -73,7 +68,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/rpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -71,7 +66,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
7 changes: 1 addition & 6 deletions buildroot-external/configs/tinker_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ BR2_PACKAGE_CA_CERTIFICATES=y
BR2_PACKAGE_LIBDNET=y
BR2_PACKAGE_LIBCGROUP=y
BR2_PACKAGE_LIBCGROUP_TOOLS=y
BR2_PACKAGE_AVAHI=y
# BR2_PACKAGE_AVAHI_AUTOIPD is not set
BR2_PACKAGE_AVAHI_DAEMON=y
BR2_PACKAGE_AVAHI_LIBDNSSD_COMPATIBILITY=y
BR2_PACKAGE_NSS_MDNS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_DHCP=y
Expand All @@ -73,7 +68,7 @@ BR2_PACKAGE_RNG_TOOLS=y
# BR2_PACKAGE_SYSTEMD_HWDB is not set
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
BR2_PACKAGE_SYSTEMD_RESOLVED=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_UTIL_LINUX_PARTX=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
id=HassOS default
uuid=f62bf7c2-e565-49ff-bbfc-a4cf791e6add
type=802-3-ethernet
llmnr=2
mdns=2

[ipv4]
method=auto
Expand Down
17 changes: 0 additions & 17 deletions buildroot-external/rootfs-overlay/etc/avahi/avahi-daemon.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
Name=%H [%m]
Type=_workstation._tcp
6 changes: 3 additions & 3 deletions buildroot-external/scripts/rootfs-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ function fix_rootfs() {
# Cleanup miscs
rm -rf "${TARGET_DIR}/usr/lib/modules-load.d"

# Don't announce services we don't offer
rm -rf "${TARGET_DIR}/etc/avahi/services/sftp-ssh.service" "${TARGET_DIR}/etc/avahi/services/ssh.service"

# Fix: permission for system connection files
chmod 600 "${TARGET_DIR}/etc/NetworkManager/system-connections"/*

Expand All @@ -27,6 +24,9 @@ function fix_rootfs() {

# Fix: Could not generate persistent MAC address
sed -i "s/MACAddressPolicy=persistent/MACAddressPolicy=none/g" "${TARGET_DIR}/usr/lib/systemd/network/99-default.link"

# Use systemd-resolved for Host OS resolve
sed -i '/^hosts:/ {s/dns/resolve [!UNAVAIL=return] dns/}' "${TARGET_DIR}/etc/nsswitch.conf"
}


Expand Down

0 comments on commit 25a0dd3

Please sign in to comment.