jsondns

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(w http.ResponseWriter, comment string, errcode int)

func IsGlobalIP

func IsGlobalIP(ip net.IP) bool

IsGlobalIP is Determine if it is a global domain name

Types

type JSONMsg

type JSONMsg struct {
	// Standard DNS response code (32 bit integer).
	Status uint32 `json:"Status"`
	// Whether the response is truncated
	TC bool `json:"TC"`
	// Always true for Google Public DNS
	RD bool `json:"RD"`
	// Always true for Google Public DNS
	RA bool `json:"RA"`
	// Whether all response data was validated with DNSSEC
	AD bool `json:"AD"`
	// 	// Whether the client asked to disable DNSSEC
	CD         bool       `json:"CD"`
	Question   []Question `json:"Question"`
	Answer     []JSONRR   `json:"Answer,omitempty"`
	Authority  []JSONRR   `json:"Authority,omitempty"`
	Additional []JSONRR   `json:"Additional,omitempty"`
	ECS        string     `json:"edns_client_subnet,omitempty"`
	Comment    string     `json:"Comment,omitempty"`
}

JSONMsg is dns json struct

type JSONRR

type JSONRR struct {
	// Always matches name in the Question section
	Name string `json:"name"`
	// Standard DNS JSONRR type
	Type uint16 `json:"type"`
	// Record's time-to-live in seconds
	TTL uint32 `json:"TTL"`
	// Data for A - IP address as text
	Data string `json:"data"`
}

JSONRR is dns rr json struct

func (*JSONRR) MarshalRR

func (jsonRR *JSONRR) MarshalRR(rr dns.RR)

MarshalRR is marshal dns RR

func (*JSONRR) UnmarshalRR

func (jsonRR *JSONRR) UnmarshalRR() (dnsRR dns.RR, err error)

UnmarshalRR is unmarshal dns RR

type Question

type Question struct {
	// FQDN with trailing dot
	Name string `json:"name"`
	// Standard DNS JSONRR type
	Type uint16 `json:"type"`
}

Question is dns question json struct

Jump to

Keyboard shortcuts

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