The operating system maintains a database of all the valid host addresses. You can use this database to convert between host names and addresses and vice-versa.
[Function]
ext: lookup-host-entry host
lookup-host-entry searches the database for the given host and returns a host-entry structure for it. If it fails to find host in the database, it returns nil. Host is either the address (as an integer) or the name (as a string) of the desired host.
[Function]
ext: host-entry-name host-entry
ext:host-entry-aliases host-entry
ext:host-entry-addr-list host-entry
ext:host-entry-addr host-entry
host-entry-name, host-entry-aliases, and host-entry-addr-list each return the indicated slot from the host-entry structure. host-entry-addr returns the primary (first) address from the list returned by host-entry-addr-list.