System/OS
2014.04.05 22:34

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

Views 4624 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 콘솔에서 패스워드 걸린 zip 압축하는 명령 hooni 2018.03.02 950
9 System/OS [virtualbox] VirtualBox에 Ubuntu 설치하기 file hooni 2019.11.22 914
8 System/OS 맥에서 포트 확인하고 닫기 (mac) hooni 2022.03.22 904
7 System/OS [mac] How to uninstall MySQL on Mac OS. hooni 2017.11.08 890
6 System/OS [mac] OS X 엘 캐피탄에서 Soudflower 사용하기 2 file hooni 2016.10.03 884
5 System/OS 개인적으로 쓰고 있는 bash_profile hooni 2015.01.16 850
4 System/OS 개인적으로 쓰고 있는 zshrc 파일 hooni 2022.02.25 835
3 System/OS [linux] The Ultimate Wget Download Guide With 15 Awesome Examples hooni 2020.05.26 810
2 System/OS [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ file hooni 2022.06.01 794
1 System/OS [apache2] Redirect HTTP to HTTPS file hooni 2022.02.03 691
Board Pagination Prev 1 ... 9 10 11 12 13 Next
/ 13