mod_dnsupdate: Support advertising explicit non-existence of service
authorKim Alvefur <zash@zash.se>
Fri, 03 Nov 2023 23:26:57 +0100
changeset 5692 429be658c0bb
parent 5691 4c84cfb586c1
child 5693 09233b625cb9
mod_dnsupdate: Support advertising explicit non-existence of service
mod_dnsupdate/mod_dnsupdate.lua
--- a/mod_dnsupdate/mod_dnsupdate.lua	Thu Nov 02 17:00:53 2023 +0000
+++ b/mod_dnsupdate/mod_dnsupdate.lua	Fri Nov 03 23:26:57 2023 +0100
@@ -121,6 +121,7 @@
 		if not opts.remove then
 			for port in ports do print(("add _%s._tcp.%s IN SRV 1 1 %d %s"):format(service, ihost, port, target)); end
 		end
+		if ports:empty() then print(("add _%s._tcp.%s IN SRV 0 0 0 ."):format(service, ihost)); end
 	end
 
 	print("show");