Get mDNS through avahi and resolved working.

First off, we need port 5353 because that's where mDNS does its thing.
It's like DNS and port 53, but doubled, right?

Next, we have to enable MulticastDNS for the network in question,
specifically the "wan" interface.

Finally, we add avahi which ... does... stuff.
This commit is contained in:
Eli Ribble 2024-08-29 18:02:04 -07:00
parent ce5b4fd7d6
commit 601129bb48
1 changed files with 19 additions and 3 deletions

View File

@ -145,6 +145,20 @@
# List services that you want to enable:
services.avahi = {
enable = true;
ipv6 = true;
ipv4 = true;
nssmdns4 = true;
nssmdns6 = true;
publish = {
addresses = true;
enable = true;
hinfo = true;
};
};
services.nginx = {
enable = true;
virtualHosts."pihole.home.arpa" = {
@ -200,7 +214,7 @@
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Disable the resolved stub listener, let Pihole do it
# Disable the resolved stub listener, let Pihole bind port 53 on all interfaces.
services.resolved = {
extraConfig = ''
DNSStubListener=no
@ -241,8 +255,8 @@
networking.firewall = {
enable = false;
allowPing = true;
allowedTCPPorts = [ 80 443 ];
allowedUDPPortRanges = [
allowedTCPPorts = [ 80 443 5353 ];
allowedUDPPortRanges = [ 5353
#{ from = 4000; to = 4007; }
#{ from = 8000; to = 8010; }
];
@ -288,6 +302,8 @@
DHCP = "ipv4";
# accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC)
IPv6AcceptRA = true;
# Allow mDNS .local address resolution
MulticastDNS = true;
};
addresses = [{
addressConfig = {