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

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!usc!wupost!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!casbah.acns.nwu.edu!cjw
  3. From: cjw@casbah.acns.nwu.edu (Christopher J. Wargaski)
  4. Subject: Re: How do I find out the domain_name of a machine ??
  5. Message-ID: <1992Sep12.192012.25100@news.acns.nwu.edu>
  6. Sender: usenet@news.acns.nwu.edu (Usenet on news.acns)
  7. Reply-To: cjw@casbah.acns.nwu.edu
  8. Organization: The Internet
  9. References:  <1992Sep12.065426.21569@umr.edu>
  10. Date: Sat, 12 Sep 1992 19:20:12 GMT
  11. Lines: 35
  12.  
  13. In article <1992Sep12.065426.21569@umr.edu>, mgj@franklin.ee.umr.edu (Mahesh Govind Joshi) writes:
  14.  
  15. |> I  am a novice at writing network applications. This is a
  16. |> beginners question.     
  17.  
  18. Beginners are welcome.
  19.  
  20. |> How do i find out the domain_name of a machine within a 'C'
  21. |> program.
  22.  
  23. Easy, use the ``gethostname'' call.  The man pages explain it
  24. wonderfully.
  25.  
  26.  
  27. |> I tried using gethostbyname(hostname) and bcopied h_addr into a
  28. |> character array. But I just get garbage when i try to print the
  29. |> array.
  30.  
  31. Close, you had the right idea!
  32.  
  33. |> Please Help !!!!
  34. |> Thanks in advance ...
  35.  
  36. My pleasure.
  37.  
  38.  
  39.  
  40. |> Mahesh Joshi
  41.  
  42.  
  43. Christopher Wargaski     <-or->     Aspheric Artwork Sigh
  44. c-wargaski@nwu.edu; ACNS, DSS, RC
  45. "Spoon-feeding in the lng run teaches us nothing more but the shape of
  46. the spoon"    --E. M. Forester
  47.  
  48.