class documentation
class Hostname(object):
Class implementing resolver and hostname functionality.
| Class Method | |
Return fqdn. |
| Class Method | |
Validate and normalize the given hostname. |
| Class Method | |
Legacy method the get the current system's name. |
| Static Method | |
Return IP address of given hostname. |
| Method | __init__ |
Initialize the host name object. |
| Instance Variable | ip |
Undocumented |
| Instance Variable | name |
Undocumented |
| Constant | _VALID |
Undocumented |
Return fqdn.
If hostname is None the system's fqdn is returned.
| Parameters | |
| hostname:str | name to be fqdn'ed |
| Returns | |
| str | fqdn of given name, if it exists, unmodified name otherwise |
Validate and normalize the given hostname.
| Raises | |
errors.OpPrereqError | when the name is not valid |
| Unknown Field: attention | |
| the validation is a bit more relaxed than the standards require; most importantly, we allow underscores in names | |
Return IP address of given hostname.
Supports both IPv4 and IPv6.
| Parameters | |
| hostname:str | hostname to look up |
| family:int | AF_INET | AF_INET6 | None |
| Returns | |
| str | IP address |
| Raises | |
errors.ResolverError | in case of errors in resolving |