리눅스 resolv.conf DNS 설정과 systemd-resolved 충돌 방지

💡 핵심 요약 (Executive Summary)

본 가이드는 etc resolv.conf 핵심 가이드 및 실전 아키텍처의 핵심 개념, 실전 구성 명령어 및 아키텍처 베스트 프랙티스를 다룹니다. 클라우드 네이티브 및 인프라 엔지니어링 실무에 즉시 활용 가능하도록 체계적으로 정리했습니다.

📑 Table of Contents
ubuntu defaults
bash
nameserver 127.0.0.53 #로컬 DNS리졸버 사용
options edns0 trust-ad
search .
coredns defaults
bash
search default.svc.cluster.local svc.cluster.local cluster.local
nameserver 10.152.183.10 #coredns serviceIP
options ndots:5
ResolveConf로만 관리 (Disable systemd-resolved)
bash
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
sudo systemctl mask systemd-resolved

sudo rm -f /etc/resolv.conf

sudo bash -c 'cat > /etc/resolv.conf <<EOF
nameserver 10.255.57.88
nameserver 8.8.8.8
nameserver 1.1.1.1
options edns0
EOF'

# 다른 서비스에서 수정금지
sudo chattr +i /etc/resolv.conf
다시 systemd-resolved 복구
bash
sudo chattr -i /etc/resolv.conf
sudo rm -f /etc/resolv.conf
sudo systemctl unmask systemd-resolved
sudo systemctl enable systemd-resolved
sudo systemctl start systemd-resolved

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *