I managed to get MDNS working earlier this year to enable my ESPHome projects to avoid having all static IP addresses and let home assistant auto-detect them. However… after some firewall tweaking recently, it all broke. So it was time again to figure out how to get MDNS to work in the Unifi system.
I started by digging into the GUI to try and find the MDNS repeater option that I had enabled last time. It no longer exists.
That lead me to needing to hack the config.gateway.json file on the controller and synchronize it to the USG that I’m running. In order to do that, I need a bit of information about my interfaces that are in use for all the VLANs. I SSH’d into my USG and ran the “show interfaces” command to get the VLAN and interface IDs for them.
Once I got all the interface names from the USG, I put them into the config file as shown below.
However I ran into a small problem, once I tried to force provision with this configuration. It got into a loop and never finished. I checked /var/log/unifi/server.log and found that I might have expected it to handle more interfaces than it could.
Commit failed , failure=1, success=1}, DELETE={failure=0, success=1}, SESSION_ID=b66a9df63d75b655eea730fb8d, SET={failure=0, success=1}} [2022-07-23T02:38:34,858] <inform-4> ERROR inform - [commit errors] dev[b4:fb:e4:2f:15:61], {COMMIT={error=�[ service mdns repeater ] Cannot configure more than five interfaces.
Now that I know that its limited to 5 interfaces, I updated the configuration to only support my IOT VLANs and the base VLAN in hopes that it would be the right amount of coverage.
After that, force provision (or for me, since the provision loop never ended, it just ended up working correctly after saving the file) and everything should be good to go. The MDNS repeater is back online and functioning. I’m still curious why ubiquity removed the MDNS repeater option from the GUI, and I hope they don’t remove the capability all together since its very useful with the small ESP devices, WLED, etc.