mirror of
https://github.com/cmur2/dyndnsd.git
synced 2024-12-22 10:54:23 +01:00
commit
567f252cad
@ -85,7 +85,7 @@ module Dyndnsd
|
|||||||
|
|
||||||
# malformed myip?
|
# malformed myip?
|
||||||
begin
|
begin
|
||||||
IPAddr.new(params["myip"], Socket::AF_INET)
|
IPAddr.new(params["myip"])
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
params["myip"] = env["REMOTE_ADDR"]
|
params["myip"] = env["REMOTE_ADDR"]
|
||||||
end
|
end
|
||||||
|
@ -19,8 +19,10 @@ module Dyndnsd
|
|||||||
out << "@ IN NS #{@dns}"
|
out << "@ IN NS #{@dns}"
|
||||||
out << ""
|
out << ""
|
||||||
zone['hosts'].each do |hostname,ip|
|
zone['hosts'].each do |hostname,ip|
|
||||||
|
ip = IPAddr.new(ip).native
|
||||||
|
type = ip.ipv6? ? "AAAA" : "A"
|
||||||
name = hostname.chomp('.' + @domain)
|
name = hostname.chomp('.' + @domain)
|
||||||
out << "#{name} IN A #{ip}"
|
out << "#{name} IN #{type} #{ip}"
|
||||||
end
|
end
|
||||||
out << ""
|
out << ""
|
||||||
out << @additional_zone_content
|
out << @additional_zone_content
|
||||||
|
Loading…
Reference in New Issue
Block a user