protected function encodeLabel(string $label): string
    {
        $encoded = '';
        
        foreach (\explode('.', $label) as $part) {
            $encoded .= \chr(\strlen($part)) . $part;
        }
        
        return $encoded . "\x00";
    }