home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10985 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.5 KB  |  44 lines

  1. Newsgroups: comp.unix.questions
  2. 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
  3. From: mgj@franklin.ee.umr.edu (Mahesh Govind Joshi)
  4. Subject: How do I find out the domain_name of a machine ??
  5. Date: Sat, 12 Sep 1992 06:54:26 GMT
  6. Nntp-Posting-Host: franklin.ee.umr.edu
  7. Reply-To: mgj@ee.umr.edu (Mahesh Govind Joshi)
  8. Organization: University of Missouri - Rolla
  9. Sender: cnews@umr.edu (UMR Usenet News Post)
  10. Originator: mgj@ee.umr.edu
  11. Message-ID: <1992Sep12.065426.21569@umr.edu>
  12. Lines: 30
  13.  
  14. Hi,
  15.  
  16. I  am a novice at writing network applications. This is a
  17. beginners question.     
  18.  
  19. How do i find out the domain_name of a machine within a 'C'
  20. program.
  21.  
  22. We have a token ring network with machine names ranging from
  23. mcs213a.cs.umr.edu to mcs213k.cs.umr.edu
  24.  
  25. I tried using 'hostname' but it returns 'mcs213[a-k]'.
  26. How do I get "mcs213[a-k].cs.umr.edu" ??
  27.  
  28. I tried using gethostbyname(hostname) and bcopied h_addr into a
  29. character array. But I just get garbage when i try to print the
  30. array.
  31.  
  32. Please Help !!!!
  33.  
  34. Thanks in advance ...
  35.  
  36. ________________________________________________________________________
  37. Mahesh Joshi             |   Bura duniya ko hai kehta
  38. Help Desk Consultant        |   Aisa bhola to na ban 
  39. Snail Mail:- 1300 N. Oak Street    |   Jo hai karta,woh hai bharta    
  40. #17, Rolla MO 65401.        |   Hai yahan ka hai chalan
  41. Voice:(314)341-8197.        |   Takdeer nahi chalnegi yahan
  42. Email : mgj@ee.umr.edu        |    ---- Majrooh Sultanpuri---- 
  43. ------------------------------------------------------------------------
  44.