Skip to content

gambol99/dns-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

DNS Update

Is a very quick and small gem which acts as a wrapper for dynamic dns via nsupdate calls.

Example Use:

options = {
  :master     => '192.168.10.12',
  :key_name   => 'rndc-key',
  :secret     => './rndc.key',
  :print_only => true
}

dns = DnsUpdate::load options

announce "CHECK: adding a host to the domain"
dns.update { |m|
  m.type = :record
  m.hostname = "yum101.domain.com"
  m.address = "192.168.19.20"
}
announce "CHECK: adding a cname to the domain"
dns.update { |m|
  m.type = :cname
  m.hostname = "yum.domain.com"
  m.cname = "yum101.domain.com"
}
announce "CHECK: adding a reverse to the domain"
dns.update { |m|
  m.type = :reverse
  m.hostname = "yum.domain.com"
  m.address = "192.168.19.20"
  m.subnet = "192.168.19.0/24"
}

# REMOVAL
announce "CHECK: removing a host to the domain"
dns.remove { |m|
  m.type = :record
  m.hostname = "yum101.domain.com"
}

announce "CHECK: removing a cname to the domain"
dns.remove { |m|
  m.type = :cname
  m.hostname = "yum.domain.com"
}
announce "CHECK: removing a reverse to the domain"
dns.remove { |m|
  m.type = :reverse
  m.hostname = "yum.domain.com"
  m.address = "192.168.19.20"
  m.subnet = "192.168.19.0/24"
}

About

A nsupdate wrapper in ruby for dynamic dns updates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages