protected function handleName(string $name, string $parent)
    {
        if ('@' === $name || '' === $name) {
            return $parent;
        }

        if ('.' !== substr($name, -1, 1)) {
            return $name.'.'.$parent;
        }

        return $name;
    }
protected function handleName(string $name, string $parent)
    {
        if ('@' === $name || '' === $name) {
            return $parent;
        }

        if ('.' !== substr($name, -1, 1)) {
            return $name.'.'.$parent;
        }

        return $name;
    }
protected function handleName ( string $ name , string $ parent ) { if ( '@' === $ name || '' === $ name ) { return $ parent ; } if ( '.' !== substr ( $ name , - 1 , 1 ) ) { return $ name . '.' . $ parent ; } return $ name ; }
Add the parent domain to names that are not fully qualified.

AbstractResolver::handleName('www', 'example.com.') //Outputs 'www.example.com.'
AbstractResolver::handleName('@', 'example.com.') //Outputs 'example.com.'
AbstractResolver::handleName('ns1.example.com.', 'example.com.') //Outputs 'ns1.example.com.'

@param $name
@param $parent

@return string
Add the parent domain to names that are not fully qualified .