🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #949

Easy way to find hostname/domainname

#949
From: Nickolay Saukh
Date: Fri, 28 Sep 1990 16:20
25 lines
1257 bytes
I need advice/software to figure out the hostname & domain name for C
programs and shell scripts. In C for hostname it seems to be quite easy:

	#if defined(BSD)
		gethostname(...);
	#endif

	#if defined(USG)
		uname(...);
	#endif

	#if defined(ANYTHING_ELSE)
		popen("uuname -l", ...);
	#endif

But how to find domain name? Look at some file with magic name? What the
name should be (with portabily issues in mind)?

The same problem for shell scripts. I know about 'hostname' command in
BSD world, 'uuname -l' for SV world (and 'uname' also).

This problem is one more 'iron curtain' (-:, which separates *NIXes
of the world. Help them unite!!!
-- 
| Nickolay Saukh | nms@saukh.rd.jvd.su | ...!fuug!demos!jvdrd!saukh!nms |
Technical Details
Message-ID: <1990Sep28.162012.14325@saukh.rd.jvd.su>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!demos!jvdrd!saukh!nms

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!demos!jvdrd!saukh!nms
From: nms@saukh.rd.jvd.su (Nickolay Saukh)
Newsgroups: comp.unix.programmer,comp.unix.questions
Subject: Easy way to find hostname/domainname
Message-ID: <1990Sep28.162012.14325@saukh.rd.jvd.su>
Date: 28 Sep 90 16:20:12 GMT
Sender: nms@saukh.rd.jvd.su (Nickolay Saukh)
Organization: JV Dialogue, Moscow, USSR
Lines: 25