lib/dyndnsd/generator/bind.rb in dyndnsd-1.3.0 vs lib/dyndnsd/generator/bind.rb in dyndnsd-1.4.0
- old
+ new
@@ -17,11 +17,13 @@
out << ""
out << "@ IN SOA #{@dns} #{@email_addr} ( #{zone['serial']} 3h 5m 1w 1h )"
out << "@ IN NS #{@dns}"
out << ""
zone['hosts'].each do |hostname,ip|
+ ip = IPAddr.new(ip).native
+ type = ip.ipv6? ? "AAAA" : "A"
name = hostname.chomp('.' + @domain)
- out << "#{name} IN A #{ip}"
+ out << "#{name} IN #{type} #{ip}"
end
out << ""
out << @additional_zone_content
out << ""
out.join("\n")