Source
func (p *Plugin) Export(key string, params []string, ctx plugin.ContextProvider) (result interface{}, err error) {
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
package dns
import (
"errors"
"fmt"
"net"
"strconv"
"strings"
"time"
"github.com/miekg/dns"
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/plugin"
"golang.zabbix.com/sdk/zbxerr"
)
const (
base10 = 10
tcpProtocol = "tcp"
udpProtocol = "udp"
inAddrSuffix = ".in-addr.arpa"
inAddrV6Suffix = ".ip6.arpa"
)
const (
noneParam = iota
firstParam
secondParam
thirdParam
fourthParam
fifthParam
sixthParam
seventhParam
)
var impl Plugin
var dnsTypes = map[string]uint16{
"ANY": dns.TypeANY,
"A": dns.TypeA,
"NS": dns.TypeNS,
"CNAME": dns.TypeCNAME,
"MB": dns.TypeMB,
"MG": dns.TypeMG,
"MR": dns.TypeMR,
"PTR": dns.TypePTR,
"MD": dns.TypeMD,