Skip to content

fix: replace hardcoded China DNS with global public DNS#20

Open
winstar0070 wants to merge 1 commit intomainfrom
fix/remove-hardcoded-dns
Open

fix: replace hardcoded China DNS with global public DNS#20
winstar0070 wants to merge 1 commit intomainfrom
fix/remove-hardcoded-dns

Conversation

@winstar0070
Copy link
Copy Markdown
Member

Summary

  • Remove China-specific DNS servers (114.114.114.114, 119.29.29.29, 223.5.5.5) from build_complete_resolv()
  • Replace with Cloudflare (1.1.1.1) and Google (8.8.8.8, 8.8.4.4) as universal fallback
  • Fix bug: old code did rm -rf /etc/resolv.conf then cp /etc/resolv.conf /etc/resolv.conf.old (backup after delete)
  • This function only runs on new image initialization (kvm_new_img flag)

Addresses #1

Changed files

  • support/sg2002/kvm_system/main/lib/system_init/system_init.cpp

Test plan

  • Flash new image, verify /etc/resolv.conf contains only 1.1.1.1, 8.8.8.8, 8.8.4.4
  • Verify DHCP-provided DNS still overrides after network init
  • Verify DNS resolution works on first boot

Remove China-specific DNS servers (114.114.114.114, 119.29.29.29,
223.5.5.5) from new image initialization resolv.conf. Replace with
Cloudflare (1.1.1.1) and Google (8.8.8.8, 8.8.4.4) as universal
fallback DNS servers.

Also fix a bug where /etc/resolv.conf was deleted before being
backed up (rm before cp).
@winstar0070
Copy link
Copy Markdown
Member Author

보류: DHCP/로컬 DNS 우선, 공개 DNS는 폴백으로 재설계 필요. udhcpc 성공 시 resolv.conf 비터치, 실패시에만 템플릿 복사. 기존 파일 보존 및 설정파일 기반 구성 주입 제안.

@winstar0070
Copy link
Copy Markdown
Member Author

Putting this PR on hold due to potential environment overrides. Summary: prefer DHCP/local resolv.conf; use public DNS only as fallback (udhcpc failure/AP mode); never overwrite existing resolv.conf (nameserver≥1); allow fallback via /etc/kvm/dns.conf; implement in S30eth/S30wifi + system_init; add safeguards/tests/docs. Will keep this PR as draft and follow up with split PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants