| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.RData.XNAME
Description
The classical RR types from RFC 1035 whose RDATA is a single
domain name: T_ns (delegation), T_cname (canonical-name
alias), and T_ptr (reverse-mapping pointer). All three share
the X_domain newtype underneath, but the types are nominally
distinct so a CNAME value can't be used where a PTR is expected
(and vice versa).
T_dname (RFC 6672) is exported alongside because it has the
same shape — a single Domain — though it does not share the
codec: DNAME's target is not subject to wire-form name
compression on encode.
The obsolete mailbox-pointer types MB, MD, MF, MG,
MR are also X_domain instances but live in
Net.DNSBase.RData.Obsolete.
RR types representing a single domain name
data X_domain (n :: Nat) where Source #
Shared wire-format representation for the RFC 1035 RR types
whose RDATA is a single domain name: NS
(section 3.3.11),
CNAME
(section 3.3.1),
PTR
(section 3.3.12),
and the obsolete mailbox-pointer types MB, MD, MF, MG,
MR (RFC 1035 sections 3.3.3-3.3.8). The type parameter n
(one of N_ns, N_cname, N_ptr, N_mb, N_md, N_mf,
N_mg, N_mr) determines the RR type. Each has its own type
synonym (T_ns, T_cname, ...) and matching pattern synonym
(T_NS, T_CNAME, ...).
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / DOMAINNAME / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Although all these RR types share a common underlying representation, the constructors are not shared and the types are not mutually coercible — this is deliberate, to catch RR-type confusion at compile time.
The target domain is subject to wire-form name compression on
encode
(RFC 3597 section 4)
and canonicalises to lower case
(RFC 4034 section 6.2).
The Eq and Ord instances compare in canonical wire form
(via equalWireHost / compareWireHost), so Ord is
canonical. Presentation preserves the original case.
Bundled Patterns
| pattern T_NS :: Domain -> T_ns | Authoritative name server for a delegated zone (RFC 1035 section 3.3.11). |
| pattern T_PTR :: Domain -> T_ptr | Domain-name pointer, typically used for reverse mapping (RFC 1035 section 3.3.12). |
| pattern T_CNAME :: Domain -> T_cname | Canonical-name alias for the owner name (RFC 1035 section 3.3.1). |
Instances
type family XdomainConName (n :: Nat) :: Symbol where ... Source #
Equations
| XdomainConName N_ns = "T_NS" | |
| XdomainConName N_cname = "T_CNAME" | |
| XdomainConName N_ptr = "T_PTR" | |
| XdomainConName N_md = "T_MD" | |
| XdomainConName N_mf = "T_MF" | |
| XdomainConName N_mb = "T_MB" | |
| XdomainConName N_mg = "T_MG" | |
| XdomainConName N_mr = "T_MR" | |
| XdomainConName n = TypeError ('ShowType n ':<>: 'Text " is not an RFC1035 domain-valued RRTYPE") :: Symbol |
The DNAME resource record
(RFC 6672 section 2.1)
— redirection for a subtree of the domain-name space: a Domain
naming the target subtree under which queries are rewritten.
The target field is not subject to wire-form name compression
on encode
(RFC 3597 section 4)
but canonicalises to lower case
(RFC 4034 section 6.2).
The Eq and Ord instances compare in canonical wire form
(via equalWireHost / compareWireHost), so Ord is
canonical. Presentation preserves the original case.
See X_domain for the sibling family of RFC 1035 single-domain
RR types, which differ from DNAME in that they do use name
compression on encode.
Instances
| Presentable T_dname Source # | Presentation form preserves case. | ||||
Defined in Net.DNSBase.RData.Internal.XNAME Methods present :: T_dname -> Builder -> Builder Source # presentLazy :: T_dname -> ByteString -> ByteString Source # | |||||
| KnownRData T_dname Source # | Name compression used on input only. | ||||
Defined in Net.DNSBase.RData.Internal.XNAME Associated Types
Methods rdataExtensionVal :: forall b -> b ~ T_dname => RDataExtensionVal T_dname Source # rdType :: forall b -> b ~ T_dname => RRTYPE Source # rdTypePres :: forall b -> b ~ T_dname => Builder -> Builder Source # rdDecode :: forall b -> b ~ T_dname => RDataExtensionVal T_dname -> Int -> SGet RData Source # | |||||
| Show T_dname Source # | |||||
| Eq T_dname Source # | Case-insensitive wire-form equality. | ||||
| Ord T_dname Source # | Case-insensitive wire-form order. | ||||
Defined in Net.DNSBase.RData.Internal.XNAME | |||||
| type RDataExtensionVal T_dname Source # | |||||
Defined in Net.DNSBase.RData.Internal.XNAME | |||||