Class: Lumberg::Whm::Dns

Inherits:
Base
  • Object
show all
Defined in:
lib/lumberg/whm/dns.rb

Instance Attribute Summary

Attributes inherited from Base

#server

Instance Method Summary collapse

Methods inherited from Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Whm::Base

Instance Method Details

#add_mx(options = {}) ⇒ Object

This function will add an MX record to a specified domain

Required

* <tt>:domain</tt>        - PENDING
* <tt>:exchange</tt>      - PENDING
* <tt>:preference</tt>    - PENDING
* <tt>:alwaysaccept</tt>  - PENDING

154
155
156
# File 'lib/lumberg/whm/dns.rb', line 154

def add_mx(options = {})
  server.perform_request('addmx', options.merge(response_key: 'data'))
end

#add_zone(options = {}) ⇒ Object

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

* <tt>:domain</tt> - PENDING
* <tt>:ip</tt> - PENDING

Optional

* <tt>:template</tt> - PENDING
* <tt>:trueowner</tt> - PENDING

14
15
16
# File 'lib/lumberg/whm/dns.rb', line 14

def add_zone(options = {})
  server.perform_request('adddns', options)
end

#add_zone_record(options = {}) ⇒ Object

Adds a DNS zone record to the server

Required

* <tt>:zone</tt> - PENDING

Optional

* <tt>:name</tt> - PENDING
* <tt>:address</tt> - PENDING
* <tt>:type</tt> - PENDING
* <tt>:class</tt> - PENDING
* <tt>:cname</tt> - PENDING
* <tt>:exchange</tt> - PENDING
* <tt>:nsdname</tt> - PENDING
* <tt>:ptdrname</tt> - PENDING
* <tt>:preference</tt> - PENDING
* <tt>:ttl</tt> - PENDING

34
35
36
# File 'lib/lumberg/whm/dns.rb', line 34

def add_zone_record(options = {})
  server.perform_request('addzonerecord', options)
end

#change_mx(options = {}) ⇒ Object

This function will change a specified domain's MX records

Required

* <tt>:domain</tt>        - PENDING
* <tt>:exchange</tt>      - PENDING
* <tt>:oldexchange</tt>   - PENDING
* <tt>:oldpreference</tt> - PENDING
* <tt>:preference</tt>    - PENDING
* <tt>:alwaysaccept</tt>  - PENDING

143
144
145
# File 'lib/lumberg/whm/dns.rb', line 143

def change_mx(options = {})
  server.perform_request('changemx', options.merge(response_key: 'data'))
end

#dump_zone(options = {}) ⇒ Object

Displays the DNS zone configuration for a specific domain

Required

* <tt>:domain</tt> - PENDING

59
60
61
# File 'lib/lumberg/whm/dns.rb', line 59

def dump_zone(options = {})
  server.perform_request('dumpzone', options)
end

#edit_zone_record(options = {}) ⇒ Object

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

* <tt>:domain</tt> - PENDING
* <tt>:Line</tt> - PENDING

Optional

* <tt>:address</tt> - PENDING
* <tt>:class</tt> - PENDING
* <tt>:cname</tt> - PENDING
* <tt>:exchange</tt> - PENDING
* <tt>:preference</tt> - PENDING
* <tt>:expire</tt> - PENDING
* <tt>:minimum</tt> - PENDING
* <tt>:mname</tt> - PENDING

90
91
92
# File 'lib/lumberg/whm/dns.rb', line 90

def edit_zone_record(options = {})
  server.perform_request('editzonerecord', options)
end

#get_zone_record(options = {}) ⇒ Object

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

* <tt>:domain</tt> - PENDING
* <tt>:Line</tt> - PENDING

51
52
53
# File 'lib/lumberg/whm/dns.rb', line 51

def get_zone_record(options = {})
  server.perform_request('getzonerecord', options)
end

#kill_dns(options = {}) ⇒ Object

Deletes a DNS zone

Required

* <tt>:domain</tt> - PENDING

98
99
100
# File 'lib/lumberg/whm/dns.rb', line 98

def kill_dns(options = {})
  server.perform_request('killdns', options)
end

#list_mxs(options = {}) ⇒ Object

This function will list a specified domain's MX records

*This function is only available in version 11.27/11.28+*

Required

* <tt>:domain</tt> - PENDING
* <tt>:"api.version".to_sym</tt> - PENDING

165
166
167
# File 'lib/lumberg/whm/dns.rb', line 165

def list_mxs(options = {})
  server.perform_request('listmxs', options.merge(response_key: 'data'))
end

#list_zones(options = {}) ⇒ Object

Generates a list of all domains and corresponding DNS zones associated with your server


39
40
41
# File 'lib/lumberg/whm/dns.rb', line 39

def list_zones(options = {})
  server.perform_request('listzones', options.merge(response_key: 'zone'))
end

#lookup_nameserver_ip(options = {}) ⇒ Object

Obtains the IP address of a registered nameserver from the root nameservers

Required

* <tt>:nameserver</tt> - PENDING

106
107
108
# File 'lib/lumberg/whm/dns.rb', line 106

def lookup_nameserver_ip(options = {})
  server.perform_request('lookupnsip', options.merge(response_key: 'ip'))
end

#remove_zone_record(options = {}) ⇒ Object

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

* <tt>:zone</tt> - PENDING
* <tt>:Line</tt> - PENDING

118
119
120
# File 'lib/lumberg/whm/dns.rb', line 118

def remove_zone_record(options = {})
  server.perform_request('removezonerecord', options)
end

#reset_zone(options = {}) ⇒ Object

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

* <tt>:domain</tt> - PENDING
* <tt>:zone</tt> - PENDING

130
131
132
# File 'lib/lumberg/whm/dns.rb', line 130

def reset_zone(options = {})
  server.perform_request('resetzone', options)
end

#resolve_domain(options = {}) ⇒ Object

Attempts to resolve an IP address for a specified domain name

Required

* <tt>:domain</tt> - PENDING
* <tt>:"api.version".to_sym</tt> - PENDING

68
69
70
# File 'lib/lumberg/whm/dns.rb', line 68

def resolve_domain(options = {})
  server.perform_request('resolvedomainname', options.merge(response_key: 'data'))
end

#save_mx(options = {}) ⇒ Object

This function will add an MX record

*This function is only available in version 11.27/11.28+*


172
173
174
# File 'lib/lumberg/whm/dns.rb', line 172

def save_mx(options = {})
  server.perform_request('savemxs', options)
end