hostname: Getting Hostname and FQDN in Racket
| (require (planet neil/hostname:1:0))|
This small package permits determining the hostname in Racket
programs. It does not support multiple names, nor does it distinguish between
This package currently relies on the "/bin/hostname" program, available on various Unix-like systems, like GNU/Linux
and Mac OS X.
(get-full-hostname) → (or/c #f string?)
Gets the full hostname (aka, fully-qualified domain name, or FQDN) of the host, or #f if unknown.
(get-short-hostname) → (or/c #f string?)
Gets the short hostname (i.e., just the hostname of the immediate host, not qualified with any parent domain names), or #f if unknown.
Copyright 2012 Neil Van Dyke. This program is Free Software; you
can redistribute it and/or modify it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version. This program is
distributed in the hope that it will be useful, but without any warranty;
without even the implied warranty of merchantability or fitness for a
particular purpose. See http://www.gnu.org/licenses/ for details. For other
licenses and consulting, please contact the author.