Getting local domain name in CLI
| From: | Geranium | Date: | Thu, 29 Aug 2002 10:57:54 +0000 |
| Subject: | Getting local domain name in CLI | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114490@lists.php.net to get a copy of this message | ||
I need to get the domain name of the local machine.
I'm running a CLI script in PHP 4.3-cvs (on OpenBSD) so I have no HTTP
or other global vars to look at. The posix_uname command doesn't
include the domain on non-GNU OSs. I can get the hostname, but not the
domain. Can I get it through some other PHP command? I'd really prefer
not to resort to rummaging in /etc and parsing files or doing something
silly like a DNS lookup...
Any ideas?