home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / admin / 4291 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  11.0 KB

  1. Xref: sparky comp.unix.admin:4291 comp.sys.sun.admin:4917
  2. Newsgroups: comp.unix.admin,comp.sys.sun.admin
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!eff!ckd
  4. From: ckd@eff.org (Christopher Davis)
  5. Subject: Re: HELP: /etc/resolv.conf for a SUN IPC
  6. In-Reply-To: nws@stout.atd.ucar.edu's message of Thu, 23 Jul 1992 16:01:56 GMT
  7. Message-ID: <CKD.92Jul23164651@loiosh.eff.org>
  8. Sender: usenet@eff.org (NNTP News Poster)
  9. Nntp-Posting-Host: loiosh.eff.org
  10. Organization: Electronic Frontier Foundation Tech Central
  11. References: <1992Jul23.160156.7101@ncar.ucar.edu>
  12. Date: Thu, 23 Jul 1992 20:49:09 GMT
  13. Lines: 271
  14.  
  15. Eddie> == Eddie Roberts (The National Weather Service) <nws@stout.atd.ucar.edu>
  16.  
  17.  Eddie> I am trying to get my system (SUN IPC 4.1.2) to use nameservers
  18.  Eddie> recently installed. I added the following lines into the
  19.  Eddie> /etc/resolv.conf file.
  20.  
  21. Can I kill Sun now?  Can I?
  22.  
  23. The problem is that Sun assumes we all love and use NIS, and DNS is only
  24. "supported" through setting magic cookies in the NIS hosts map, etc.
  25.  
  26. Here's a repost of Greg Earle's explanation as to how to fix this (IMHO,
  27. extremely annoying) situation.
  28.  
  29. Newsgroups: comp.sys.sun.admin
  30. From: earle@poseur.JPL.NASA.GOV (Greg Earle - Sun JPL on-site Software Support)
  31. Subject: Re: Domain Name Server
  32. Organization: Sun Microsystems - JPL on-site Software Support
  33.  
  34. In article <1992Jun19.193017.2952@asihub.sd.cadence.com> Eric D. Williams <ericw@sd.cadence.com> writes:
  35. >In article <1992Jun3.123530.20956@hp9000.csc.cuhk.hk> ST Wong writes:
  36. >>I'm configuring our Sparc2, running SunOS 4.1.  My problem is that I
  37. >>uses HP 845S as our domain name server while the Sparc2 is a client
  38. >>only.  I follow the instructions in the Network Admin. manual of SunOS
  39. >>to set up those files needed but, it doesn't work.  When I uses inet
  40. >>services (e.g. telnet, ftp, etc), it only searches the /etc/hosts file.
  41. >>However, when I uses nslookup, it points to the domain name server !
  42. >>
  43. >>I don't know what's wrong with that.
  44. >>
  45. >>Would anyone please help ?  Any help will be much appreciated.
  46. >
  47. >  Well sure I can help you, but you won't like the answer.  Sun makes
  48. >  it look like it supports DNS, but they really don't.  SunOS will only
  49. >  use either local files or NIS to resolve names.  It doesn't matter if
  50. >  /etc/resolve.conf is set up correctly or not.  That's because all the
  51. >  name resolver libraries won't look to the nameserver, only to NIS.
  52. >  To get DNS to work on a Sun, you need to: 
  53. >  
  54. >       1. Run NIS.
  55. >       2. Make *all* you NIS servers be Suns. 
  56. >       3. When you start ypserv (on your Sun server), you specify
  57. >      a special switch on the command line to do DNS lookups. 
  58. >      Of cource only SunOS supports this switch.
  59. >      
  60. >  Only the ypserv process will use the correct DNS resolver routines to
  61. >  access the nameserver.  So Sun is really doing their DNS lookups
  62. >  through NIS.  But what if you don't run NIS??  Tough.  Even a lowly
  63. >  Macintosh or PC has the right stuff to access a name server, but a
  64. >  Sun?  Forget it.
  65.  
  66. It is my greatest fear that someone on the Net will read this posting and
  67. actually consider it to be something authoritative as opposed to the
  68. unmitigated rubbish it, in fact, is.
  69.  
  70. For your future edification, I present the following 12 Step program for your
  71. rehabilitation:
  72.  
  73. 1. Ensure that the "Shlib Custom" optional software category has been loaded
  74.    from your SunOS 4.1.x O/S media.
  75.  
  76. 2. cd to "/usr/lib/shlib.etc", and shove the prepared README file to README-
  77.  
  78. 3. Replace said README file with the version to follow at the end of this
  79.  
  80. 4. Follow the instructions contained within said README, paying close attention
  81.    once you've reached step #4
  82.  
  83. 5. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  84.  
  85. 6. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  86.  
  87. 7. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  88.  
  89. 8. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  90.  
  91. 9. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  92.  
  93. 10. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  94.  
  95. 11. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  96.  
  97. 12. Repeat after me, "Hmmn, this crow sure is mighty tasty!"
  98.  
  99. Enjoy your meal.
  100.  
  101. ------------------------------ >8  Cut here  8< ------------------------------
  102.  
  103.     This is a procedure you can use to substitute or add 
  104. a module in your shared libc library. 
  105.  
  106. Note! if you are interested in a System V libc, please substitute
  107.     libcs5_pic.a for libc_pic.a in step 3, 
  108.     libcs5.so.x.y.z for libc.so.x.y.z in step 14.
  109.  
  110. -------------------------------------------------------------------------
  111.  
  112. 1. Become super user
  113.     % su
  114.  
  115. 2. Make a temporary directory
  116.     % mkdir tmp
  117.  
  118. 3. Change to the "tmp" directory just made, extract the pic .o from 
  119.    libc_pic.a and rm the file __.SYMDEF. The reason you need to do 
  120.    the 2 "mv" commands is because "ar" truncated filenames over 
  121.    16 characters.
  122.     % cd tmp
  123.     % ar x ../libc_pic.a
  124.     % rm __.SYMDEF
  125.     % mv rpc_dtablesize. rpc_dtablesize.o
  126.     % mv rpc_commondata. rpc_commondata.o
  127.     % mv xccs_multibyte. xccs_multibyte.o
  128.  
  129.    Note: this last mv command is not present in the original version of the
  130.    README file that comes in /usr/lib/shlib.etc/README.  If this step is
  131.    omitted, you will produce a shared libc.so that does not contain the
  132.    xccs_multibyte.o module.  This module contains versions of the library
  133.    functions "mbtowc", "wctomb", "mbstowcs" and "wcstombs" (see mblen(3) for
  134.    more info on these multi-byte character functions), which operate on the
  135.    Xerox XCCS codeset standard.  Specifically, the missing functions will be
  136.  
  137.     _mbtowc_xccs(pwc, s, n)
  138.     _wctomb_xccs(s, pwc)
  139.     _mbstowcs_xccs(pwc, s, n)
  140.     _wcstombs_xccs(s, pwc, n)
  141.  
  142.    These are called by the corresponding "mbtowc", "wctomb", "mbstowcs" and
  143.    "wcstombs" functions if the codeset is XCCS (other codesets include EUC,
  144.    ISO 2022, and a default).  In short, if you use any Internationalization
  145.    features and need to handle multi-byte character sets, do not forget this
  146.    step.
  147.  
  148. 4. If you are doing this to specifically create a libc.so that contains
  149.    the DNS resolver routines for doing hostname/hostaddr lookups via the
  150.    Domain Name Service (and not NIS/YP), do these additional steps.  If not,
  151.    please skip down to step 10.
  152.  
  153. 5. Extract the contents of /usr/lib/libresolv.a into the tmp directory:
  154.     % ar x /usr/lib/libresolv.a
  155.     % rm __.SYMDEF
  156.  
  157.    The libresolv.a contains object modules that are position
  158.    independant, so they can be added to the libc_pic modules without fear.
  159.  
  160.    NOTE: You may wish to install Sun patch 100465-01 *first* before taking
  161.    this step, as it provides a newer patched version of /usr/lib/libresolv.a.
  162.    This fixes a serious bug that causes DNS nameserver lookups to fail if the
  163.    first name server query yields ECONNREFUSED (Connection refused), even if
  164.    the other nameservers specified in /etc/resolv.conf are both up & working:
  165.  
  166. Patch i.d.    Bug i.d's    SunOS    Description
  167. ----------    ---------    -----    -----------
  168. 100465-01    1076977
  169.             4.1 4.1 4.1.2 DNS res_send() fails if first nameserver
  170.             in /etc/resolv.conf returns ECONNREFUSED
  171.  
  172. 6. Remove the old routine to do the hostname/addr resolution:
  173.     % rm gethostent.o
  174.  
  175. 7. Remove the libresolv module that contains `strncasecmp' (which is now
  176.    in the main C library, so it is redundant):
  177.     % rm strcasecmp.o
  178.  
  179. 8. As also mentioned below (in step 11), edit the file `lorder-sparc' in the ..
  180.    directory.  Remove the reference to `gethostent.o' and add the
  181.    references to the resolver library routines by applying this patch:
  182.  
  183.     % cd ..
  184.     % diff -rc2 lorder-sparc.orig lorder-sparc
  185.     *** lorder-sparc.orig   Thu Feb  8 05:27:46 1990
  186.     --- lorder-sparc    Mon Apr  9 12:58:59 1990
  187.     ***************
  188.     *** 150,154 ****
  189.       getwd.o
  190.       getnetgrent.o
  191.     ! gethostent.o
  192.       ypxdr.o
  193.       ttyname.o
  194.     --- 150,161 ----
  195.       getwd.o
  196.       getnetgrent.o
  197.     ! gethostnamadr.o
  198.     ! sethostent.o
  199.     ! res_query.o
  200.     ! res_mkquery.o
  201.     ! res_send.o
  202.     ! res_debug.o
  203.     ! res_comp.o
  204.     ! res_init.o
  205.       ypxdr.o
  206.       ttyname.o
  207.  
  208. 9. If you are running under SunOS 4.1.2, you will want to add the entry
  209.    "mblib.o" to the very end of the "lorder-sparc" file.  If you aren't running
  210.    SunOS 4.1.2, you may now skip down to step 13.
  211.  
  212.    Also, you will need to patch the Makefile, as follows:
  213.  
  214.     *** Makefile.orig    Wed Oct 23 10:13:00 1991
  215.     --- Makefile    Mon Feb 24 18:38:08 1992
  216.     ***************
  217.     *** 9,13 ****
  218.       
  219.       libc.so:
  220.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp`
  221.           /bin/ls /usr/lib/libc.so.* > TMP_FILE
  222.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  223.     --- 9,13 ----
  224.       
  225.       libc.so:
  226.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp` -ldl
  227.           /bin/ls /usr/lib/libc.so.* > TMP_FILE
  228.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  229.     ***************
  230.     *** 15,19 ****
  231.       
  232.       libcs5.so:
  233.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp`
  234.           /bin/ls /usr/5lib/libc.so.* > TMP_FILE
  235.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  236.     --- 15,19 ----
  237.       
  238.       libcs5.so:
  239.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp` -ldl
  240.           /bin/ls /usr/5lib/libc.so.* > TMP_FILE
  241.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  242.  
  243. 10. Replace or add the .o that you wanted by doing a copy. Please
  244.     note here that you are advised to create your object with
  245.     the following compiler option, i.e "cc -c -pic yourprogram.c" to make
  246.     it shareable.
  247.     % cp your.o .
  248.  
  249. 11. If you add a new module then you need to do this step.
  250.     You need to edit the file "lorder-sparc" and add the name of the file
  251.     you have copied from step 4 at the end of this file. 
  252.     % vi ../lorder-sparc
  253.  
  254. 12.     % cd ..
  255.  
  256. 13.     % make libc.so
  257.  
  258. 14. Now you should have some libc.so.x.y.z built in the current directory.
  259.     It is recommended that you tested out this library at this point 
  260.     before installing it. You can do so by setting the environment
  261.     LD_LIBRARY_PATH  to the current directory for example:
  262.        % setenv LD_LIBRARY_PATH `pwd`
  263.     % your_favorite_test_cmd
  264.     Once you are satisfied that the new library worked, you can proceed
  265.     to install it with the following commands:
  266.     % cp libc.so.x.y.z /usr/lib
  267.     % ldconfig
  268.     % unsetenv LD_LIBRARY_PATH
  269.  
  270. 15. You are now running with the new library.  You can verify this by
  271.     doing a trace command of, let's say, "date".
  272.     % trace date
  273.     The output should informed you that the new library is being used.
  274. -- 
  275.                                           ______                                                                        ,__,~~, \
  276.                                                                /      /  \   ______________________________________________________________    ` ~^   \ _|
  277. / "Who would have ever believed that I could include an ASCII  \  ()^()---|/@)  \  picture of myself in my .signature file!"              ___  /   /_       )'
  278.  \______________________________________________________,'   \_\__ | .    / |                                                                  `-'  \___,  / \      Greg Earle    earle@poseur.JPL.NASA.GOV                        \`
  279.  
  280.  
  281. --
  282. Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
  283.    ``The First Amendment is often inconvenient.  But that is besides the
  284.   point.  Inconvenience does not absolve the government of its obligation
  285.          to tolerate speech.'' --Justice Anthony Kennedy, in 91-155
  286.