Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!haven.umd.edu!darwin.sura.net!howland.reston.ans.net!noc.near.net!das-news.harvard.edu!kepler!jiu From: jiu@kepler.uucp (Haibin Jiu) Subject: domain name Message-ID: <1993Jul2.203312.2808@das.harvard.edu> Sender: usenet@das.harvard.edu (Network News) Organization: Harvard University Engineering Labs Date: Fri, 2 Jul 1993 20:33:12 GMT Lines: 13 Hi! I am writing a program in which I attempt to get the name of the current domain. On my Sun workstation I use getdomainname(2) and it returns the correct string. But when I try to port it to other systems, the returned string varies according to system. To see what your system will return, you can type "domainname" at the UNIX prompt. Does anyone know of a sure way to obtain the correct domainname, hostname, or a combination of both? Thanks. HBJ