Re: Obtaining domain name
- From: "desas2@xxxxxxxxx" <desas2@xxxxxxxxx>
- Date: Thu, 04 Oct 2007 20:37:53 -0700
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
.
- Follow-Ups:
- Re: Obtaining domain name
- From: Michael T Pins
- Re: Obtaining domain name
- References:
- Obtaining domain name
- From: Henrik Goldman
- Re: Obtaining domain name
- From: Michael T Pins
- Obtaining domain name
- Prev by Date: Re: SED problem
- Next by Date: Re: http header
- Previous by thread: Re: Obtaining domain name
- Next by thread: Re: Obtaining domain name
- Index(es):
Relevant Pages
|
|