Documentation
¶
Overview ¶
Package rdap reads the registration date of a domain from the RDAP server of its registry (RFC 9082, RFC 9083), found through the IANA bootstrap file (RFC 9224), never through a third-party aggregator (docs/sources.md).
Only the registrable domain is sent, and only the domain object's own registration and last changed events are read: entities, and so the contacts they hold, are never decoded. Answers are cached for a day, "not found" and "no server" for a few minutes, and a registry that sends a Retry-After is left alone for that long.
Index ¶
Constants ¶
const BootstrapURL = "https://data.iana.org/rdap/dns.json"
BootstrapURL is the IANA bootstrap file for domain names (RFC 9224).
const Source domain.Source = "RDAP"
Source names the registry in reports.
Variables ¶
var ( // ErrBootstrap means the IANA bootstrap file could not be read. ErrBootstrap = errors.New("unusable RDAP bootstrap file") // ErrNoServer means the bootstrap file names no HTTPS RDAP server for // the domain's extension. ErrNoServer = fmt.Errorf("no RDAP server for this extension: %w", app.ErrNotCovered) // ErrNotFound means the registry answered that it holds no such domain. ErrNotFound = fmt.Errorf("domain not found in RDAP: %w", app.ErrNotFound) // ErrThrottled means the registry asked to wait (Retry-After) and the // wait is not over. No request was sent. ErrThrottled = errors.New("RDAP server asked to wait") // ErrResponse means the registry's answer is not an RDAP domain object. ErrResponse = errors.New("invalid RDAP domain response") )
Functions ¶
func BootstrapHosts ¶
func BootstrapHosts() []string
BootstrapHosts returns the hosts the bootstrap client reaches, for its allowlist.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads the registration dates of domains from the RDAP server of their registry. It is safe for concurrent use.
func New ¶
func New(iana Getter, bootstrapURL string, dial func(hosts []string) (Getter, error)) (*Client, error)
New returns a Client that reads the bootstrap file at bootstrapURL with iana, and queries registries with the client dial builds for the hosts the file names: the allowlist follows the file, and a user input only ever selects one of its servers.