dns

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dns provides DNS record formatting and display utilities.

This package handles the formatting and display of DNS records required for AhaSend domain verification across different DNS providers and formats:

  • DNS record parsing from AhaSend domain responses
  • Multi-format output (BIND, Cloudflare, Terraform)
  • Interactive DNS configuration instructions
  • Provider-specific formatting and syntax
  • Copy-paste friendly record formats

The package supports common DNS providers and infrastructure-as-code tools, making it easy for users to configure their domains regardless of their DNS setup.

Index

Constants

This section is empty.

Variables

View Source
var Formats = []string{"bind", "cloudflare", "terraform"}

Formats are the provider formats FormatDNSRecordsForProvider writes.

Functions

func FormatDNSRecordsForProvider added in v0.3.0

func FormatDNSRecordsForProvider(records []DNSRecord, provider string) []string

FormatDNSRecordsForProvider formats each record in provider, one of Formats. Terraform resources get labels unique among records.

func PrintDNSInstructions

func PrintDNSInstructions(w io.Writer, recordSet *DNSRecordSet)

PrintDNSInstructions writes DNS configuration instructions to w

func ProviderComment added in v0.3.0

func ProviderComment(record DNSRecord, provider string) string

ProviderComment returns the comment line that goes before record in provider, one of Formats: whether the record is optional or required, with its note, or "" for a required record without a note. Bind comments start with ";", the others with "#".

Types

type DNSRecord

type DNSRecord struct {
	Type  string
	Name  string
	Value string
	TTL   int
	// Required is whether the domain needs the record to send email. An
	// optional record enables a feature.
	Required bool
	// Note says what an optional record is for, or how to add a required
	// record of a kind a name can have only one of; "" when there is
	// nothing to say.
	Note string
}

DNSRecord represents a DNS record with formatting options

type DNSRecordSet

type DNSRecordSet struct {
	Domain  string
	Records []DNSRecord
}

DNSRecordSet represents a collection of DNS records for a domain

func FormatDNSRecords

func FormatDNSRecords(domain *responses.Domain) *DNSRecordSet

FormatDNSRecords formats DNS records for display

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL