| [ internet ] in KIDS 글 쓴 이(By): trying (태훈) 날 짜 (Date): 1996년05월01일(수) 10시14분56초 KST 제 목(Title): [Re] DNS/NIS(Sun4.1.3에서 name service) 이 질문은 정말 많이 나오는 것인데 누군가 정리해 주면 좋겠군요... 말씀하 신 증상은 정상적인 것입니다. nslookup은 /etc/resolv.conf에 name server만 제 대로 지정되어 있으면 제대로 작동합니다.. 그러나 name service는 얘기가 다르죠. name service를 받고 싶으시다면 NIS를 인스톨하시면 됩니다. Solaris 2.4 에서는 화일 하나만 고쳐주면 name service를 받을 수 있지만 SUN 4.1.3에서는 NIS를 인스톨해서 그 문제를 해결하지요... 그 외에도 여러 가지 방법이 있지만 제 생 각으로는 NIS를 인스톨해서 해결하시는 것이 좋겠군요.(저도 그렇게 하고 있습니다.) NIS는 NIS 서버에 있는 시스템 화일(passwd, hosts 등)을 공유하기 위한 것인 데 편법으로 name service만을 위해 쓰기도 합니다. NIS를 인스톨(정확히 말하면 NIS를 통한 name service 받는 법)은 다음과 같습니다. 어디선가 읽은 것인데 그 냥 인용하도록 하겠습니다.(원래 쓰신 분도 이해해 주시리라 믿고요....) 다음을 잘 읽어보고 그대로 해보시기 바랍니다... 3.1. super user로 전환을 한다. # su 3.2. domainname 지정 이름의 길이는 256까지 가능하나 가능한 짧은 이름이좋다. 명령어 domain name을 이 용해 현재 설정되어 있는 이름을 알 수가 있는데, 대개 기본적으로 nonam e으로 설정되어 있는 경우가 많으니, 원하는 이름으로 반드시 설정해야 한다. doma inname은 명령어로 직접 정해줄 수 있으나, 컴퓨터가 부팅시 /etc 디렉토리 에 있는 shell 스크립트를 통해 /etc/defaultdomain 파일에 적혀진 이름으로 domainname을 설정하므로 반드시 /etc/defaultdomain 파일에 적 어 주어야 한다.(명령어로 domainname을 확인, 혹은 정해주려 면 다음과 같이 하면 된다). # domainname noname # # domainname aa.co.kr # # domainame aa.co.kr 3.3. hostname 지정 NIS service에 관련된 컴퓨터중 master server, slave server, client를 정 하며, 컴퓨 터들이 hostname을 가졌는지 확인한다. hostname은 컴퓨터가 booting시 에 /etc/hostname.xx# 파일에 저장된 내용으로 정해진다. xx#는 컴퓨터에서사용하 는 ethernet controller chip이 어 느회사에서 만들어졌는지에 따라 달라진다. (comma nd로 hostname을 확인, 혹은 정해주려면 다 음과 같이 하면 된다. # hostname noname # # hostname han # # hostname han 4.4. /etc/hosts 화일 /etc/hosts 파일의 내용을 적절히 수정하다. 가능한 각 실에 서 한 administrator가 관리할 수 있는 컴퓨터들만 포함되도록 한다. 즉 han이라는 컴퓨터가 있으면 다음과 같이 /etc/hosts 파일을 작성하며 특히 유의할점은 loopb ack address (127.0.0.1)는 반드시 포함되도록 한다. +-----------------------------------------------------+ | 127.0.0.1 localhost | | 128.134.1.1 han.hana.nm.kr han loghost | +-----------------------------------------------------+ 4.5. yp 설치 directory의 위치를 '/var/yp' 로 옮긴다. 만약 /var 밑에 yp directory가 없으면 필요한 directory와 파일을 다른 시스템에서 복사한다. /var/yp d irectory 밑에는 'Makefile'과 'updaters' 파일이 있어야 한다. #cd /var/yp 'Makefile' 파일 의 내용중 다음의 line을 설정한다. 아울러/usr/lib di rectory에 'NIS.Makefile'이 있는 경우 똑같이 고쳐준다. 변경전 변경후 #B=-b B=-b B= #B= 다음과 같이 'Makefile'을 실행시켜 준다. '-m'의 의미는 YP를 master로 설치 한다는 것이다. # /usr/etc/yp/ypinit -m 위와 같이 명령어를 실행시 키면 NIS가 몇가지 질문을 하게 되는데, 이때 단 지 return key 와 ctrl-d를 이용하여 하면 된다. 그리고 hostname을 입력하도록 요 구하면 ctrl-d로 빠져 나와 계속 return key를 치면 된다. 몇가지 error가 발생해도 문제가 없다. 다음은 앞에서 실 행한 명령어의 결과를 보여주는 것이다(그림자로 표 시된 것은 입력한 부분을 나타낸다). Installing the NIS data base will require that you answer a fewquestions. Do you want this procedure to quit on non-fatal errors? [y/n: n] n OK, please remember to go back and redo manually whatever fails. If you do n't, some part of the system (perhaps the NIS itself) won't work. At this point, we have to construct a list of the hosts which will run NI Sservers. tao is in the list of NIS server hosts. Please continue to addthe names for the other hosts, one per line. When you are done with thelist, type a <control D>. next host to add: han next host to add: ^D The current list of NIS servers looks like this: han Is this correct? [y/n: y] y There will be no further questions. The remainder of the procedure shoul dtake5 to 10 minutes. Building /var/yp/babo/ypservers... Running /var/yp/Makefile... updated group updated hosts make: Warning: Don't know how to make target `/etc/ethers'Current working directory /var/yp updated networks updated rpc updated services updated protocols make: Warning: Don't know how to make target `/etc/netgroup'Current working directory /var/yp make: Warning: Don't know how to make target `/etc/bootparams'Current working directory /var/yp updated publickey updated netid /usr/etc/yp/makedbm /etc/netmasks /var/yp/`domainname`/netmasks.byaddr; updated netmasks couldn't find /etc/timezone couldn't find /etc/auto.master 이로서 NIS를 올리기 위한 기본적인 작업은 끝났고, 그 다음은 필요한 daemon을 실행시켜야 한다. # ypserv # ypbind 그 밖의 NIS 관련 daemon이 더 있지만 필요하지 않으므로 , /etc directory 에 존재하는 rc* 파일에서 comment로 처리하여 주면 된다. 참고 : /etc/hosts 파일의 변경 내용을 NIS DB로 바꾸려면 /var/yp directory 의 위치에서 다음과 같이 하면 된다. # make hosts |