func (c *Conn) ResolveAddress(ctx context.Context, ifindex int, family int, address net.IP, flags uint64) (names []Name, outflags uint64, err error) {
	err = c.Call(ctx, "ResolveAddress", ifindex, family, address, flags).Store(&names, &outflags)
	return
}
ResolveAddress takes a DNS resource record (RR) type, class and name
and retrieves the full resource record set (RRset), including the RDATA, for it.
ctx: Context to use
ifindex: Network interface index where to look (0 means any)
family: Address family (syscall.AF_INET, syscall.AF_INET6)
address: the binary address (4 or 16 bytes)
flags: Input flags parameter
package resolved
import (
	"context"
	"errors"
	"fmt"
	"net"
	"os"
	"strconv"
	"github.com/godbus/dbus/v5"
	"github.com/miekg/dns"
)
const (
	dbusDest      = "org.freedesktop.resolve1"
	dbusInterface = "org.freedesktop.resolve1.Manager"
	dbusPath      = "/org/freedesktop/resolve1"
)
type Conn struct {
	conn *dbus.Conn
	obj  dbus.BusObject
}
func NewConn() (*Conn, error) {
	conn, err := dbus.SystemBusPrivate()
	if err != nil {
		return nil, fmt.Errorf("failed to init private conn to system bus: %v", err)
	}
	methods := []dbus.Auth{dbus.AuthExternal(strconv.Itoa(os.Getuid()))}
	err = conn.Auth(methods)
	if err != nil {
		conn.Close()
		return nil, fmt.Errorf("failed to auth with external method: %v", err)
	}
	err = conn.Hello()
	if err != nil {
		conn.Close()
		return nil, fmt.Errorf("failed to make hello call: %v", err)
	}
	return &Conn{
		conn: conn,
		obj:  conn.Object(dbusDest, dbus.ObjectPath(dbusPath)),
	}, nil
}
func (c *Conn) Call(ctx context.Context, method string, args ...interface{}) *dbus.Call {
	return c.obj.CallWithContext(ctx, fmt.Sprintf("%s.%s", dbusInterface, method), 0, args...)
}
func (c *Conn) Close() error {
	return c.conn.Close()
}
const (
	SD_RESOLVED_DNS           = uint64(1) << 0
	SD_RESOLVED_LLMNR_IPV4    = uint64(1) << 1
	SD_RESOLVED_LLMNR_IPV6    = uint64(1) << 2
	SD_RESOLVED_MDNS_IPV4     = uint64(1) << 3
	SD_RESOLVED_MDNS_IPV6     = uint64(1) << 4
	SD_RESOLVED_NO_CNAME      = uint64(1) << 5
	SD_RESOLVED_NO_TXT        = uint64(1) << 6
	SD_RESOLVED_NO_ADDRESS    = uint64(1) << 7
	SD_RESOLVED_NO_SEARCH     = uint64(1) << 8
	SD_RESOLVED_AUTHENTICATED = uint64(1) << 9
)
type Address struct {
	IfIndex int     
	Family  int     
	Address net.IP  
}
func (a Address) String() string {
	return fmt.Sprintf(`{
	IfIndex: %d,
	Family:  %d,
	IP:      %s,
}`, a.IfIndex, a.Family, a.Address.String())
}
func (c *Conn) ResolveHostname(ctx context.Context, ifindex int, name string, family int, flags uint64) (addresses []Address, canonical string, outflags uint64, err error) {
	err = c.Call(ctx, "ResolveHostname", ifindex, name, family, flags).Store(&addresses, &canonical, &outflags)
	return
}
type Name struct {
	IfIndex  int     
	Hostname string  
}
func (n Name) String() string {
	return fmt.Sprintf(`{
	IfIndex: %d,
	Name:    %s,
}`, n.IfIndex, n.Hostname)
}