DNS Record

DNS record objects are returned by DNSQuestion:getRecords() and accepted by DNSQuestion:addAnswer(), DNSQuestion:addRecord() and DNSQuestion:setRecords().

class DNSRecord

Represents a single DNS record. It has these attributes:

name

The name of the record. A DNSName.

place

The place where the record is located,

  • 0 for the question section
  • 1 for the answer section
  • 2 for the authority section
  • 3 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.

And the following methods:

:changeContent(newcontent)

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

Parameters:newcontent (str) – The replacing content
:getCA() → ComboAddress

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

:getContent() → str

Return a string representation of the record content.