NFSN DNS Driver Documentation¶
NFSN, Inc. is a U.S. company that provides web hosting and domain name server services.
Instantiating the driver¶
To instantiate the driver you need to pass the account name and API key to the driver constructor as shown below. Obtain your API key from NFSN by submitting a secure support request via the control panel.
from libcloud.dns.types import Provider
from libcloud.dns.providers import get_driver
cls = get_driver(Provider.NFSN)
driver = cls("<account name>", "<api key>")
API Docs¶
-
class
libcloud.dns.drivers.nfsn.NFSNDNSDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]¶ Parameters: - key (
str) – API key or username to used (required) - secret (
str) – Secret password to be used (required) - secure (
bool) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default. - host (
str) – Override hostname used for connections. - port (
int) – Override port used for connections.
Returns: None-
connectionCls¶ alias of
libcloud.common.nfsn.NFSNConnection
-
create_record(name, zone, type, data, extra=None)[source]¶ Create a new record.
Parameters: - name (
str) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument. - zone (
Zone) – Zone where the requested record is created. - type (
RecordType) – DNS record type (A, MX, TXT). - data (
str) – Data for the record (depends on the record type). - extra (
dict) – Extra attributes (driver specific, e.g. ‘ttl’). (optional)
Return type: Record- name (
-
create_zone(domain, type='master', ttl=None, extra=None)¶ Create a new zone.
Parameters: - domain (
str) – Zone domain name (e.g. example.com) - type (
str) – Zone type (master / slave). - ttl (
int) – TTL for new records. (optional) - extra (
dict) – Extra attributes (driver specific). (optional)
Return type: Zone- domain (
-
delete_record(record)[source]¶ Use this method to delete a record.
Parameters: record (Record) – record to delete Return type: Bool
-
delete_zone(zone)¶ Delete a zone.
Note: This will delete all the records belonging to this zone.
Parameters: zone ( Zone) – Zone to delete.Return type: bool
-
ex_get_records_by(zone, name=None, type=None)[source]¶ Return a list of records for the provided zone, filtered by name and/or type.
Parameters: - zone (
Zone) – Zone to list records for. - zone – Zone where the requested records are found.
- name (
str) – name of the records, for example “www”. (optional) - type (
RecordType) – DNS record type (A, MX, TXT). (optional)
Returns: listofRecord- zone (
-
export_zone_to_bind_format(zone)¶ Export Zone object to the BIND compatible format.
Parameters: zone ( Zone) – Zone to export.Returns: Zone data in BIND compatible format. Return type: str
-
export_zone_to_bind_zone_file(zone, file_path)¶ Export Zone object to the BIND compatible format and write result to a file.
Parameters: - zone (
Zone) – Zone to export. - file_path (
str) – File path where the output will be saved.
- zone (
-
get_record(zone_id, record_id)¶ Return a Record instance.
Parameters: - zone_id (
str) – ID of the required zone - record_id (
str) – ID of the required record
Return type: Record- zone_id (
-
get_zone(zone_id)[source]¶ Return a Zone instance.
Parameters: zone_id ( str) – name of the required zone, for example “example.com”.Return type: ZoneRaises: ZoneDoesNotExistError: If no zone could be found.
-
iterate_records(zone)¶ Return a generator to iterate over records for the provided zone.
Parameters: zone ( Zone) – Zone to list records for.Return type: generatorofRecord
-
iterate_zones()¶ Return a generator to iterate over available zones.
Return type: generatorofZone
-
list_record_types()¶ Return a list of RecordType objects supported by the provider.
Returns: listofRecordType
-
list_records(zone)[source]¶ Return a list of all records for the provided zone.
Parameters: zone ( Zone) – Zone to list records for.Returns: listofRecord
-
list_zones()¶ Return a list of zones.
Returns: listofZone
-
update_record(record, name, type, data, extra=None)¶ Update an existing record.
Parameters: - record (
Record) – Record to update. - name (
str) – Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string (‘’) for this argument. - type (
RecordType) – DNS record type (A, AAAA, …). - data (
str) – Data for the record (depends on the record type). - extra (
dict) – (optional) Extra attributes (driver specific).
Return type: Record- record (
-
update_zone(zone, domain, type='master', ttl=None, extra=None)¶ Update an existing zone.
Parameters: - zone (
Zone) – Zone to update. - domain (
str) – Zone domain name (e.g. example.com) - type (
str) – Zone type (master / slave). - ttl (
int) – TTL for new records. (optional) - extra (
dict) – Extra attributes (driver specific). (optional)
Return type: Zone- zone (
- key (