1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2025-08-08 08:33:56 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
cn
cfce5be361 Bump version 2016-11-27 22:21:16 +01:00
cn
9ae2a63af2 Pin rack gem in Gemfile to ~> 1.6 for ruby < 2.2.2 support 2016-11-27 22:21:08 +01:00
Christian Nicolai
567f252cad Merge pull request #2 from haasn/ipv6
Support IPv6 addresses
2015-06-18 14:11:37 +02:00
Niklas Haas
d2747549fe Support IPv6 addresses
This also checks for IPv6-mapped IPv4 addresses.

Closes #1.
2015-06-18 06:09:46 +02:00
4 changed files with 6 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.executables = ['dyndnsd'] s.executables = ['dyndnsd']
s.add_runtime_dependency 'rack' s.add_runtime_dependency 'rack', '~> 1.6'
s.add_runtime_dependency 'json' s.add_runtime_dependency 'json'
s.add_runtime_dependency 'metriks' s.add_runtime_dependency 'metriks'

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
module Dyndnsd module Dyndnsd
VERSION = "1.3.0" VERSION = "1.4.0"
end end