# NSHost class reference

lukeh@xedoc.com.au
richard@brainstorm.co.uk
Generated at 2025-02-13 06:02:40 +0000
1996, 1997,1999 Free Software Foundation, Inc.
Software documentation for the NSHost class
Foundation/NSHost.h
Instances of this class encapsulate host information. Constructors based on host name or numeric address are provided.
currentHost
Get current host object.
flushHostCache
Clear cache of host info instances.
hostWithAddress:
address
Get a host object. Hosts are cached for efficiency. The address must be an IPV4 "dotted decimal" string, e.g. NSHost aHost = [NSHost hostWithAddress:@"192.42.172.1"];
hostWithName:
name
Get info for host with given DNS name.
isHostCacheEnabled
Return host cache management. If enabled, only one object representing each host will be created, and a shared instance will be returned by all methods that return a host.
setHostCacheEnabled:
flag
Set host cache management. If enabled, only one object representing each host will be created, and a shared instance will be returned by all methods that return a host.
address
Return host address in "dotted decimal" notation, e.g. "192.42.172.1". Chosen arbitrarily if a host has more than one.
addresses
Return all known addresses for host in "dotted decimal" notation, e.g. "192.42.172.1".
isEqualToHost:
aHost
Compare hosts. Hosts are equal if they share at least one address
localizedName
If the receiver is the currentHost, returns the default name of the computer, otherwise returns `nil`.
name
Return host name. Chosen arbitrarily if a host has more than one.
names
Return all known names for host.
Software documentation for the NSHost(GNUstep) category
Foundation/NSHost.h
Adds synonym for +currentHost .
localHost
Synonym for +currentHost .