module Lumberg
module Whm
class Dns < Base
# Creates a DNS zone. All zone information other than domain name and IP address is created based on the standard zone template in WHM.
# Your MX, nameserver, domain PTR, and A records will all be generated automatically
#
# ==== Required
# * :domain - PENDING
# * :ip - PENDING
#
# ==== Optional
# * :template - PENDING
# * :trueowner - PENDING
def add_zone(options = {})
server.perform_request('adddns', options)
end
# Adds a DNS zone record to the server
#
# ==== Required
# * :zone - PENDING
#
# ==== Optional
# * :name - PENDING
# * :address - PENDING
# * :type - PENDING
# * :class - PENDING
# * :cname - PENDING
# * :exchange - PENDING
# * :nsdname - PENDING
# * :ptdrname - PENDING
# * :preference - PENDING
# * :ttl - PENDING
def add_zone_record(options = {})
server.perform_request('addzonerecord', options)
end
# Generates a list of all domains and corresponding DNS zones associated with your server
def list_zones(options = {})
server.perform_request('listzones', options.merge(:response_key => 'zone'))
end
# Return zone records for a domain.
#
# To use this function most effectively, you may first wish to run the dumpzone function for the domain(s) whose record(s) you wish to retrieve.
# The Line output variable from that function call can then be used as a reference to create the input for this function.
#
# ==== Required
# * :domain - PENDING
# * :Line - PENDING
def get_zone_record(options = {})
server.perform_request('getzonerecord', options)
end
# Displays the DNS zone configuration for a specific domain
#
# ==== Required
# * :domain - PENDING
def dump_zone(options = {})
server.perform_request('dumpzone', options)
end
# Attempts to resolve an IP address for a specified domain name
#
# ==== Required
# * :domain - PENDING
# * :"api.version".to_sym - PENDING
def resolve_domain(options = {})
server.perform_request('resolvedomainname', options.merge(:response_key => 'data'))
end
# Allows you to edit a DNS zone record on the server.
#
# To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to edit.
# The output of that function call will be used as a reference to create the input for this function.
#
# ==== Required
# * :domain - PENDING
# * :Line - PENDING
#
# ==== Optional
# * :address - PENDING
# * :class - PENDING
# * :cname - PENDING
# * :exchange - PENDING
# * :preference - PENDING
# * :expire - PENDING
# * :minimum - PENDING
# * :mname - PENDING
def edit_zone_record(options = {})
server.perform_request('editzonerecord', options)
end
# Deletes a DNS zone
#
# ==== Required
# * :domain - PENDING
def kill_dns(options = {})
server.perform_request('killdns', options)
end
# Obtains the IP address of a registered nameserver from the root nameservers
#
# ==== Required
# * :nameserver - PENDING
def lookup_nameserver_ip(options = {})
server.perform_request('lookupnsip', options.merge(:response_key => 'ip'))
end
# Allows you to remove a DNS zone record from the server.
#
# To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to remove.
# The output of that function call will be used as a reference to create the input for this function.
#
# ==== Required
# * :zone - PENDING
# * :Line - PENDING
def remove_zone_record(options = {})
server.perform_request('removezonerecord', options)
end
# Restore a DNS zone to its default values. This includes any subdomain DNS records associated with the domain.
#
# This function can be useful for restoring DNS zones that have become corrupted or have been improperly edited.
# It will also restore zone file subdomains listed in the server's httpd.conf file, along with default settings for new accounts.
#
# ==== Required
# * :domain - PENDING
# * :zone - PENDING
def reset_zone(options = {})
server.perform_request('resetzone', options)
end
# This function will change a specified domain's MX records
#
# ==== Required
# * :domain - PENDING
# * :exchange - PENDING
# * :oldexchange - PENDING
# * :oldpreference - PENDING
# * :preference - PENDING
# * :alwaysaccept - PENDING
def change_mx(options = {})
server.perform_request('changemx', options.merge(:response_key => 'data'))
end
# This function will add an MX record to a specified domain
#
# ==== Required
# * :domain - PENDING
# * :exchange - PENDING
# * :preference - PENDING
# * :alwaysaccept - PENDING
def add_mx(options = {})
server.perform_request('addmx', options.merge(:response_key => 'data'))
end
# This function will list a specified domain's MX records
#
# *This function is only available in version 11.27/11.28+*
#
# ==== Required
# * :domain - PENDING
# * :"api.version".to_sym - PENDING
def list_mxs(options = {})
server.perform_request('listmxs', options.merge(:response_key => 'data'))
end
# This function will add an MX record
#
# *This function is only available in version 11.27/11.28+*
def save_mx(options = {})
server.perform_request('savemxs', options)
end
end
end
end