DNSRecord objects

A DNSRecord object represents a record. Creating a DNSRecord is done with the newDR().

Functions and methods of a DNSRecord

newDR(name, type, ttl, content, place) → DNSRecord

Returns a new DNSRecord object.

Parameters:
  • name (DNSName) – The name to the new record
  • type (string) – The type of the record
  • ttl (int) – The TTL of the record
  • content (string) – The content of the record
  • place (int) – The place where the record is located (as an integer, see DNSRecord.place)
class DNSRecord

A DNSRecord object represents a DNS record.

name

The name of the record. A DNSName.

place

The place where the record is located, you can use the following constants

  • pdns.place.QUESTION for the question section
  • pdns.place.ANSWER for the answer section
  • pdns.place.AUTHORITY for the authority section
  • pdns.place.ADDITIONAL for the additional section
ttl

The TTL of the record

type

The type of the record (as an integer). Can for example be compared to pdns.A

DNSRecord:getContent() -> string

Return a string representation of the record content

DNSRecord:getCA() -> ComboAddress

If the record type is A or AAAA, a ComboAddress representing the content is returned, nil otherwise

DNSRecord:changeContent(newcontent)

Replace the record content with newcontent. The type and class cannot be changed.

Parameters:newcontent (str) – The replacing content