home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!usenet-feed.cc.umr.edu!cnews
- From: mgj@franklin.ee.umr.edu (Mahesh Govind Joshi)
- Subject: How do I find out the domain_name of a machine ??
- Date: Sat, 12 Sep 1992 06:54:26 GMT
- Nntp-Posting-Host: franklin.ee.umr.edu
- Reply-To: mgj@ee.umr.edu (Mahesh Govind Joshi)
- Organization: University of Missouri - Rolla
- Sender: cnews@umr.edu (UMR Usenet News Post)
- Originator: mgj@ee.umr.edu
- Message-ID: <1992Sep12.065426.21569@umr.edu>
- Lines: 30
-
- Hi,
-
- I am a novice at writing network applications. This is a
- beginners question.
-
- How do i find out the domain_name of a machine within a 'C'
- program.
-
- We have a token ring network with machine names ranging from
- mcs213a.cs.umr.edu to mcs213k.cs.umr.edu
-
- I tried using 'hostname' but it returns 'mcs213[a-k]'.
- How do I get "mcs213[a-k].cs.umr.edu" ??
-
- I tried using gethostbyname(hostname) and bcopied h_addr into a
- character array. But I just get garbage when i try to print the
- array.
-
- Please Help !!!!
-
- Thanks in advance ...
-
- ________________________________________________________________________
- Mahesh Joshi | Bura duniya ko hai kehta
- Help Desk Consultant | Aisa bhola to na ban
- Snail Mail:- 1300 N. Oak Street | Jo hai karta,woh hai bharta
- #17, Rolla MO 65401. | Hai yahan ka hai chalan
- Voice:(314)341-8197. | Takdeer nahi chalnegi yahan
- Email : mgj@ee.umr.edu | ---- Majrooh Sultanpuri----
- ------------------------------------------------------------------------
-