System/OS
2014.04.05 22:34

[linux] resolv.con 초기화 되는 문제

Views 4616 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
network를 재시작하면, resolv.conf가 자동 초기화 되는 현상을 겪었다.
그러던중 아래와 같은 원인과 해결책을 찾았다.

리눅스에서 DNS 설정을 바꾸려고 아래 파일을 수정한다.
/etc/resolv.conf
그리고 아래와 같이 서비스를 재시작 하거나 리부팅한다.
/sbin/service network restart
 
하지만  vmware 상에서는 /etc/resolv.conf 수동설정이 안된다.
DHCP 로 ip 를 자동으로 할당 받을때 /sbin/dhclient-script 에 의해서 resolv.conf 파일이 새로 생성되기 때문이다.
(vi /var/log/boot.log 를 보면 dhclient-script 가 /etc/resolv.conf 를 수정하는 것을 알수 있다.)
 
이 문제를 해결하기 위해서 /sbin/dhclient-script 가 /etc/resolv.conf 를 수정하지 못하도록 파일 속성을 불변으로 바꾼다.
chattr +i /etc/resolv.conf


[참고] 아래와 같은 경고가 나온다면 참고..
Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0...
[해결방법] https://www.hooni.net/xe/39012
?

List of Articles
No. Category Subject Author Date Views
10 System/OS [linux] wget 명령 사용 예제 hooni 2020.05.26 1434
9 System/OS [mac] VirtualBox 실행 스크립트와 bash_profile 설정 file hooni 2020.07.08 954
8 System/OS How to Install and Use wget on Mac file hooni 2020.09.03 1277
7 System/OS Apache CORS 설정 1 hooni 2020.09.04 2710
6 System/OS [펌] 마이크로서비스, 모노리포, SRE, ... 덮어놓고 구글 따라하면 안 되는 기술들 file hooni 2020.10.15 943
5 System/OS [apache2] Redirect HTTP to HTTPS file hooni 2022.02.03 680
4 System/OS 개인적으로 쓰고 있는 zshrc 파일 hooni 2022.02.25 824
3 System/OS 맥에서 포트 확인하고 닫기 (mac) hooni 2022.03.22 890
2 System/OS [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ file hooni 2022.06.01 785
1 System/OS 네트워크 용어 정리 file hooni 2022.11.20 1209
Board Pagination Prev 1 ... 9 10 11 12 13 Next
/ 13