Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QDnsHostInfo Class Reference

The QDnsHostInfo class provides information about a host name lookup. More...

    #include <QDnsHostInfo>

Note: All the functions in this class are reentrant.

- List of all members, including inherited members

### Public Types

- enum Error { NoError, HostNotFound, UnknownError }

### Public Functions

- QDnsHostInfo ()
- QDnsHostInfo ( const QDnsHostInfo & hostInfo )
- ~QDnsHostInfo ()
- QList<QHostAddress> addresses () const
- Error error () const
- QString errorString () const
- QString host () const
- QDnsHostInfo & operator= ( const QDnsHostInfo & hostInfo )

## Detailed Description

The QDnsHostInfo class provides information about a host name lookup.

A QDnsHostInfo is passed to the slot invoked by QDns::getHostByName(). It contains the result of the lookup.

host() returns the host name that was looked up. Call addresses() to get the list of IP addresses for the host.

If the lookup failed, error() returns the type of error that occurred. errorString() gives a human-readable description of the lookup error.

See also QDns.

## Member Type Documentation

### enum QDnsHostInfo::Error

`QDnsHostInfo::NoError` | The lookup was successful.
`QDnsHostInfo::HostNotFound` | No IP addresses were found for the host.
`QDnsHostInfo::UnknownError` | An unknown error occurred.

## Member Function Documentation

### QDnsHostInfo::QDnsHostInfo ()

Constructs an empty host info object.

### QDnsHostInfo::QDnsHostInfo ( const QDnsHostInfo & hostInfo )

Copy constructor. Copies the data of hostInfo.

### QDnsHostInfo::~QDnsHostInfo ()

Destroys the host info object.

### QList<QHostAddress> QDnsHostInfo::addresses () const

Returns the list of IP addresses returned by the host name lookup; this list may be empty.

See also host().

### Error QDnsHostInfo::error () const

If the host name lookup failed, this function returns the type of error that occurred; otherwise NoError is returned.

See also QDnsHostInfo::Error and errorString().

### QString QDnsHostInfo::errorString () const

If the lookup failed, this function returns a human readable description of the error; otherwise "Unknown error" is returned.

See also error().

### QString QDnsHostInfo::host () const

Returns the name of the host whose IP addresses were looked up.

### QDnsHostInfo & QDnsHostInfo::operator= ( const QDnsHostInfo & hostInfo )

Assigns the data of the hostInfo object to this host info object, and returns a reference to it.