Re: Getting the domain name



At about the time of 3/23/2007 11:06 AM, Michael B Allen stated the
following:
Can anyone recommend a portable way of getting the domain name of the
local machine? I find it amazing that there's no builtin method for
doing this (gethostname does not necessarily contain the domain).

Mike


I had the exact same problem a few years ago. I wrote a tool to do just
that. I'm running FreeBSD, so I just do this:

DOMAINNAME="`hostname | domain`"

That's using FreeBSD's version of Borne Shell.

Since yours is adding a period on the end, you will have to modify the
source to strip the period out. I have the source code posted on source
forge.

http://sourceforge.net/projects/ipdomaintools/

Hope this helps.



--
Daniel Rudy

Email address has been base64 encoded to reduce spam
Decode email address using b64decode or uudecode -m

Why geeks like computers: look chat date touch grep make unzip
strip view finger mount fcsk more fcsk yes spray umount sleep
.



Relevant Pages

  • Re: CRT Tube Socket
    ... Decode email address using b64decode or uudecode -m ... look chat date touch grep make unzip ... strip view finger mount fcsk more fcsk yes spray umount sleep ...
    (sci.electronics.repair)
  • Re: Segmentation Fault....
    ... Decode email address using b64decode or uudecode -m ... look chat date touch grep make unzip ... strip view finger mount fcsk more fcsk yes spray umount sleep ...
    (comp.lang.c)
  • Re: Kerlock/Harlock
    ... > transfer his essence into the mainframe computer of Harlock's ship the ... Some characters die over and over again, ... Decode email address using b64decode or uudecode -m ... strip view finger mount fcsk more fcsk yes spray umount sleep ...
    (rec.arts.anime.misc)
  • Re: Sanyo DS31580 Dead - Blown Fuse
    ... fuse and now it turns on, I hear the whine of the flyback, and then it ... I did fix my Sony ... Decode email address using b64decode or uudecode -m ... strip view finger mount fcsk more fcsk yes spray umount sleep ...
    (sci.electronics.repair)
  • Re: format for declaring variables?
    ... struct thread *td; ... It's just so much easier to read, less error prone (since there are ... Decode email address using b64decode or uudecode -m ... strip view finger mount fcsk more fcsk yes spray umount sleep ...
    (comp.lang.c)

Loading