Ubuntu 18.04 를 사용중인데, 보안 업데이트를 하기 위해서 apt 명령을 입력했더니 다음과 같이 도메인을 찾을 수 없는 이유로 오류가 생긴다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
root@ubuntu:~# apt update Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. |
“Temporary failure resolving” 이게 뭘까 싶어서 알아본 내용을 정리한다. resolve.conf 파일을 열어보면 다음과 같이 되어 있을 것이다.
|
1 2 3 4 5 6 7 |
root@ubuntu:~# cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers. nameserver 127.0.0.53 |
resolv.conf 파일은 다들 알다시피 도메인 네임 서버를 지정해주는 설정 파일로 이 파일이 잘못되면 도메인을 ip로 변환할 수가 없게되어 결국에는 인터넷 연결을 할 수가 없게 된다. 그런데, 위 내용을 보면 도메인 서버 ip는 로컬 호스트로 보이고 코멘트에 이것을 수동으로 바꾸지 말것을 경고하고 […]