You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dns.go
    path of file: ./repos/netbird/dns
    
    the code of the file until where you have to start completion: // Package dns implement dns types and standard methods and functions
// to parse and normalize dns records and configuration
package dns

import (
	"fmt"
	"net"
	"regexp"
	"strings"

	"github.com/miekg/dns"
	"golang.org/x/net/idna"
)

const (
	// DefaultDNSPort well-known port number
	DefaultDNSPort = 53
	// RootZone is a string representation of the root zon
    
func GetParsedDomainLabel(name string) (string, error) {
	labels := dns.SplitDomainName(name)
	if len(labels) == 0 {
		return "", fmt.Errorf("got empty label list for name \"%s\"", name)
	}
	rawLabel := labels[0]
	ascii, err := idna.Punycode.ToASCII(rawLabel)
	if err != nil {
		return "", fmt.Errorf("unable to convert host label to ASCII, error: %v", err)
	}

	validHost := strings.ToLower(invalidHostMatcher.ReplaceAllString(ascii, "-"))
	if len(validHost) > 58 {
		validHost = validHost[:59]
	}

	return validHost, nil
}