Re: Obtaining domain name



On Oct 4, 3:04 pm, Michael T Pins <mtp...@xxxxxxxxx> wrote:
"Henrik Goldman" <henrik_gold...@xxxxxxxxxxxx> writes:
Hello,
I'm looking for a way in linux, solaris, macosx, etc. to obtain the domain
name or fully qualified domain name for the current host.
Is there any api for that?

No, there isn't.
The best way I've found so far is to look for a "domain" line in
/etc/resolv.conf and combine it (after some possible mangling) with the
results of gethostname().

--
Michael T Pins
mtp...@xxxxxxxxx
keeper of the nn sourceshttp://www.nndev.org

How about "nslookup hostname" ?

Dinakar Desai



.



Relevant Pages

  • Obtaining domain name
    ... I'm looking for a way in linux, solaris, macosx, etc. to obtain the domain ... name or fully qualified domain name for the current host. ...
    (comp.unix.programmer)
  • Re: Headless X windows
    ... >> very easy for any pc to start a session. ... >> Now on the other hand, if you do NOT have a video head the host will ... > you were running Solaris, BSD or Linux there you could understand it more ... KDE/or solaris default X then I choose that from my LOCAL server? ...
    (comp.unix.solaris)
  • Re: Solaris 10: order of searching for host names
    ... hosts: files dns ... But under Solaris 10, it ain't so anymore. ... But worse, if the internet connection is down, then it will keep trying ... and that happens for every attempt to access your LAN; ping for some host ...
    (comp.unix.solaris)
  • Re: Solaris 10: order of searching for host names
    ... hosts: files dns ... But under Solaris 10, it ain't so anymore. ... But worse, if the internet connection is down, then it will keep trying ... and that happens for every attempt to access your LAN; ping for some host ...
    (comp.unix.solaris)
  • Re: mpxio-disable="no";
    ... fault/tolerance and load/balancing and all were good and easier to make. ... I have onw CX/400 with two DM-24M fiber switch and each host is connected ... have PowerPath and SOlaris 8/9 (I did not scheduled to upgrade to SOlaris 10 ... which has two physical connections 'behind the scenes' ...
    (comp.unix.solaris)