How determine "Fully Qualified Domain Name" from domain name?

Hello

How can I determine "Fully Qualified Domain Name" from domain name using Windows API?

Thanks.
wajszleAsked:
Who is Participating?
 
bbaoConnect With a Mentor IT ConsultantCommented:
// Check if <<name>> is a fully qualified domain name
//
// Returns |true| if the name contains at least one dot and other
// characters around that dot.

bool
HostInfo::isfqdn (const char *name)
{
    bool seendot = false;
    bool seenpre = false;
    bool seenpost = false;

    for ( ; name && *name && !seenpost; ++name)
        if (! seendot && *name != '.')
            seenpre = true;
        else if (seenpre && *name == '.')
            seendot = true;
        else if (seendot && *name != '.')
            seenpost = true;

    return seenpost;
}
0
All Courses

From novice to tech pro — start learning today.