Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!munnari.oz.au!bruce!merlin!ianh From: ianh@resmel.bhp.com.au (Ian Hoyle) Newsgroups: comp.unix.admin Subject: Re: How to get telnet/ftp to use the resolver? Message-ID: Date: 16 May 91 21:29:56 GMT References: <1991May14.170912.9951@phillip.edu.au> <3366@mtecv2.mty.itesm.mx> <1996@maserati.qsp.UUCP> Sender: usenet@resmel.bhp.com.au (USEnet nntp account) Organization: BHP Research - Melbourne Laboratories, AUSTRALIA Lines: 134 rich@mont.cs.missouri.edu (Rich Winkel) writes: >In <1996@maserati.qsp.UUCP> scotts@qsp.COM (Scott Simpers) writes: >>In article <3366@mtecv2.mty.itesm.mx> josevela@mtecv2.mty.itesm.mx (Jose Angel Vela Avila) writes: >>>martin@phillip.edu.au writes: >>>> I've setup the resolver and named on our sun IPC and using >>>>nslookup everything seems to be fine. However I, can't get telnet, >>>>ftp etc to use the name resolver. If I'm NOT running NIS, how do I get >>>>everything to use the resolver? >>The problem is that you are working on a Sun. They EXPECT to run NIS. I don't >>believe you can turn it off and have things work right. You can tell the >>ypserv process to look to DNS/resolver by using the 'ypserv -d' command. >Nope. I'm using a sun slc right now (sunos 4.1.1) which is not running >NIS, but is using the resolver. You have to apply the patches to libc.so >which have been posted to a number of groups on the net. >I'll post it if there's interest. I got this from a local SUN engineer .... hope it helps !! ian o MAKING A LIBC.SO for DNS without NIS This is a procedure you can use to add name resolver routines into your shared libc library in SunOS_4.1. You must have fist loaded "SHLIB CUSTOM" either from suninstall or from add_services. Be sure to first have the file /etc/resolv.conf configured properly. You can test this first with /usr/etc/nslookup. ------------------------------------------------------------------------- 1. Become super user % su (if necessary) 2. Make a temporary directory % cd /usr/lib/shlib.etc % mkdir tmp 3. Change to the "tmp" directory just made, extract the pic .o from libc_pic.a and rm the file __.SYMDEF. The reason you need to do the 2 "mv" commands is because "ar" truncated filenames over 16 characters. % cd tmp % ar x ../libc_pic.a % rm __.SYMDEF % mv rpc_dtablesize. rpc_dtablesize.o % mv rpc_commondata. rpc_commondata.o % ar x /usr/lib/libresolv.a The libresolv.a (apparently) contains object modules that are position independant, so they can be added to the libc_pic modules without fear. 4. Remove the old routine to do the hostname/addr resolution: % rm gethostent.o 5. Remove the libresolv module that contains `strncasecmp' (which is now in the main C library, so it is redundant): % rm strcasecmp.o 6. % cd .. 7. Copy lorder-sparc to lorder-sparc.orig Edit the file lorder-sparc and remove the reference to `gethostent.o' and add the references to the resolver library routines by applying this patch: remove : gethostent.o add : gethostnamadr.o sethostent.o res_query.o res_mkquery.o res_send.o res_debug.o res_comp.o res_init.o % diff -rc2 lorder-sparc.orig lorder-sparc *** lorder-sparc.orig Thu Feb 8 05:27:46 1990 --- lorder-sparc Mon Apr 9 12:58:59 1990 *************** *** 150,154 **** getwd.o getnetgrent.o ! gethostent.o ypxdr.o ttyname.o --- 150,161 ---- getwd.o getnetgrent.o ! gethostnamadr.o ! sethostent.o ! res_query.o ! res_mkquery.o ! res_send.o ! res_debug.o ! res_comp.o ! res_init.o ypxdr.o ttyname.o 8. % make libc.so 9. Now you should have some libc.so.x.y.z built in the current directory. It is recommended that you tested out this library at this point before installing it. You can do so by setting the environment LD_LIBRARY_PATH to the current directory for example: % setenv LD_LIBRARY_PATH `pwd` % your_favorite_test_cmd (ie. ping, ftp, telnet) Once you are satisfied that the new library worked, you can proceed to install it with the following commands: % cp libc.so.x.y.z /usr/lib % ldconfig % unsetenv LD_LIBRARY_PATH 10. You are now running with the new library. You can verify this by doing a trace command of let's say "date". % trace date The output should informed you that the new library is being used. -- Ian Hoyle /\/\ Image Processing & Data Analysis Group / / /\ BHP Research - Melbourne Laboratories / / / \ 245 Wellington Rd, Mulgrave, 3170 / / / /\ \ AUSTRALIA \ \/ / / / \ / / / Phone : +61-3-560-7066 \/\/\/ FAX : +61-3-561-6709 E-mail : ianh@resmel.bhp.com.au