from dns.rdataclass import RdataClass
from dns.rdatatype import RdataType
import dns.rdtypes.ANY.CNAME
+import dns.rdtypes.ANY.DNAME
import dns.rdtypes.ANY.MX
import dns.rdtypes.ANY.NS
import dns.rdtypes.ANY.PTR
self.nsc_zone.nsc._add_reverse_mapping(a, parse_name(self.name, origin=self.nsc_zone.dns_name))
return self
+ def CNAME(self, target: Name | str) -> Self:
+ self._add(dns.rdtypes.ANY.CNAME.CNAME(RdataClass.IN, RdataType.CNAME, target))
+ return self
+
+ def DNAME(self, target: Name | str) -> Self:
+ self._add(dns.rdtypes.ANY.DNAME.DNAME(RdataClass.IN, RdataType.DNAME, target))
+ return self
+
def MX(self, pri: int, name: str) -> Self:
self._add(
dns.rdtypes.ANY.MX.MX(RdataClass.IN, RdataType.MX, pri, parse_name(name))
self._add(dns.rdtypes.ANY.NS.NS(RdataClass.IN, RdataType.NS, name))
return self
- def TXT(self, *text: str | List[str]) -> Self:
- for txt in flatten_list(text):
- self._add(dns.rdtypes.ANY.TXT.TXT(RdataClass.IN, RdataType.TXT, txt))
- return self
-
def PTR(self, target: Name | str) -> Self:
self._add(dns.rdtypes.ANY.PTR.PTR(RdataClass.IN, RdataType.PTR, target))
return self
- def CNAME(self, target: Name | str) -> Self:
- self._add(dns.rdtypes.ANY.CNAME.CNAME(RdataClass.IN, RdataType.CNAME, target))
- return self
-
def SRV(self, priority: int, weight: int, port: int, target: Name | str) -> Self:
self._add(dns.rdtypes.IN.SRV.SRV(RdataClass.IN, RdataType.SRV, priority, weight, port, parse_name(target)))
return self
+ def TXT(self, *text: str | List[str]) -> Self:
+ for txt in flatten_list(text):
+ self._add(dns.rdtypes.ANY.TXT.TXT(RdataClass.IN, RdataType.TXT, txt))
+ return self
+
def generic(self, typ: str, text: str) -> Self:
self._add(dns.rdata.from_text(RdataClass.IN, typ, text))
return self