Documentation ¶
Index ¶
- func GetDomain(name string) string
- func GetIpVersion(ip string) (version uint8)
- type DnsHelper
- func (instance *DnsHelper) CanSendEmails(addr string) (response bool, err error)
- func (instance *DnsHelper) GetDomainName(addr string) (response string, err error)
- func (instance *DnsHelper) GetInfo(addr string) (response *DnsInfo, err error)
- func (instance *DnsHelper) GetIpVersion(ip string) (version uint8)
- func (instance *DnsHelper) GetLocalAddress() (address string, err error)
- func (instance *DnsHelper) GetPublicAddress() (address string, err error)
- func (instance *DnsHelper) IsIPAddress(value string) (success bool)
- func (instance *DnsHelper) LookupAddr(ip string) (response []string, err error)
- func (instance *DnsHelper) LookupCNAME(host string) (response string, err error)
- func (instance *DnsHelper) LookupHost(host string) (addrs []string, err error)
- func (instance *DnsHelper) LookupIP(host string) (response []net.IPAddr, err error)
- func (instance *DnsHelper) LookupMX(name string) (response []*net.MX, err error)
- func (instance *DnsHelper) LookupNS(name string) (response []*net.NS, err error)
- func (instance *DnsHelper) LookupSRVTcp(service, name string) (cname string, response []*net.SRV, err error)
- func (instance *DnsHelper) LookupSRVUdp(service, name string) (cname string, response []*net.SRV, err error)
- func (instance *DnsHelper) LookupTXT(name string) (response []string, err error)
- func (instance *DnsHelper) SetServer(value string) *DnsHelper
- func (instance *DnsHelper) SetServerGoogle() *DnsHelper
- type DnsIPInfo
- type DnsISPInfo
- type DnsInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIpVersion ¶
Types ¶
type DnsHelper ¶
type DnsHelper struct {
// contains filtered or unexported fields
}
func NewDnsHelper ¶
func NewDnsHelper() (instance *DnsHelper)
func (*DnsHelper) CanSendEmails ¶
func (*DnsHelper) GetDomainName ¶
func (*DnsHelper) GetIpVersion ¶
func (*DnsHelper) GetLocalAddress ¶
GetLocalAddress return local IP
func (*DnsHelper) GetPublicAddress ¶
GetPublicAddress return IP of current ISP provider using IPIFY.org
func (*DnsHelper) IsIPAddress ¶
func (*DnsHelper) LookupAddr ¶
LookupAddr does a reverse lookup for the address and returns a list of names that map to the address. The LookupAddr() function performs a reverse finding for the address and returns a list of names that map to the given address. USage: LookupAddr("6.8.8.8")
func (*DnsHelper) LookupCNAME ¶
LookupCNAME returns the final name after following zero or more CNAME records. CNAME is the abbreviation for canonical name. CNAMEs are essentially domain and subdomain text aliases to bind traffic. The LookupCNAME() function accepts a host-name(m.facebook.com) as a string and returns a single canonical domain name for the given host. Usage: LookupCNAME("m.facebook.com")
func (*DnsHelper) LookupHost ¶
LookupHost returns the host addresses using the local resolver. Usage: LookupHost("localhost")
func (*DnsHelper) LookupIP ¶
LookupIP returns a hosts IP addresses. It is now preferred over the Hosts method to resolve a name to IP. The LookupIP() function accepts a string(domain-name) and returns a slice of net.IP objects that contains host's IPv4 and IPv6 addresses. Usage: LookupIP("google.com)
func (*DnsHelper) LookupMX ¶
LookupMX returns the DNS MX records for the domain name, sorted by preference. These records identify the servers that can exchange emails. The LookupMX() function takes a domain name as a string and returns a slice of MX structs sorted by preference. An MX struct is made up of a Host as a string and Pref as a uint16. Usage: LookupMX("google.com")
func (*DnsHelper) LookupNS ¶
LookupNS returns DNS NS records for the domain name. The NS records describe the authorized name servers for the zone. The NS also delegates subdomains to other organizations on zone files. The LookupNS() function takes a domain name(facebook.com) as a string and returns DNS-NS records as a slice of NS structs. Usage: LookupNS("gmail.com")
func (*DnsHelper) LookupSRVTcp ¶
func (instance *DnsHelper) LookupSRVTcp(service, name string) (cname string, response []*net.SRV, err error)
LookupSRVTcp attempts to resolve an SRV query of the service, protocol (tcp), and domain name, sorted by priority and randomized by weight within a priority. Usage: LookupSRVTcp("xmpp-server", "google.com")
func (*DnsHelper) LookupSRVUdp ¶
func (instance *DnsHelper) LookupSRVUdp(service, name string) (cname string, response []*net.SRV, err error)
LookupSRVUdp attempts to resolve an SRV query of the service, protocol (udp), and domain name, sorted by priority and randomized by weight within a priority. Usage: LookupSRVUdp("xmpp-server", "google.com")
func (*DnsHelper) LookupTXT ¶
LookupTXT returns DNS TXT records for the domain name. This text record stores information about the SPF that can identify the authorized server to send email on behalf of your organization. The LookupTXT() function takes a domain name(facebook.com) as a string and returns a list of DNS TXT records as a slice of strings.
func (*DnsHelper) SetServerGoogle ¶
type DnsISPInfo ¶
type DnsISPInfo struct { IP string `json:"ip"` ASN string `json:"asn"` ISPName string `json:"name"` Country string `json:"country"` Registry string `json:"registry"` Range string `json:"range"` AllocatedAt string `json:"time"` }
func (*DnsISPInfo) String ¶
func (instance *DnsISPInfo) String() string
type DnsInfo ¶
type DnsInfo struct { InitialRawAddress string `json:"initial-raw-address"` // requested Domain string `json:"domain"` IPInfo []*DnsIPInfo `json:"ip-info"` ISPInfo []*DnsISPInfo `json:"isp-info"` CanSendEmails bool `json:"can-send-email"` TXT []string `json:"txt"` ISPName string `json:"isp-name"` ISPCountry string `json:"isp-country"` Errors []string `json:"errors"` }