Skip to content

Prefer the registry over /etc/resolv.conf on native Windows - #153

Merged
hsbt merged 1 commit into
masterfrom
claude/ruby-resolv-memory-bug-93457f
Oct 2, 2026
Merged

hsbt merged 1 commit into
masterfrom
claude/ruby-resolv-memory-bug-93457f

Conversation

@hsbt

@hsbt hsbt commented Oct 1, 2026

Copy link
Copy Markdown
Member

On native Windows, Resolv::DNS::Config.default_config_hash checks /etc/resolv.conf before the registry. That path resolves against the current drive, so running from a drive that has etc\resolv.conf at its root makes Resolv::DNS ignore the DNS servers configured in Windows and use that file instead.

This reads Win32::Resolv.get_resolv_info first on mswin, MinGW and JRuby on Windows. Cygwin keeps the old order because its own resolver honors /etc/resolv.conf, and dropping it there would make Resolv disagree with getaddrinfo.

I could not run the Cygwin branch of the new test locally.

Generated with Claude Code

On native Windows `/etc/resolv.conf` resolves against the current drive, so a stray `etc\resolv.conf` at the drive root shadowed the DNS settings in the registry. Cygwin keeps reading the file first because its own resolver honors it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt merged commit 0275974 into master Oct 2, 2026
74 checks passed
@hsbt
hsbt deleted the claude/ruby-resolv-memory-bug-93457f branch October 2, 2026 00:49
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.

1 participant