New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment
link

Issue 117655: Respect nsswitch.conf when using HOSTS file with --enable-async-dns

Reported by szym@chromium.org, Mar 10 2012 Project Member

Issue description

The common /etc/nsswitch.conf includes:
  hosts: files dns
meaning that the HOSTS file is checked before a DNS request is made.

However, if it says something else, we need to either abandon using HostResolverImpl::DnsTask or implement the proper logic. For instance:
  hosts: dns files
instructs to only use HOSTS if a DNS transaction fails.

The first step would be to determine how often users have a non-standard nsswitch.conf
 

Comment 1 by bugdroid1@chromium.org, Mar 10 2013

Project Member
Labels: -Area-Internals -Internals-Network-DNS Cr-Internals Cr-Internals-Network-DNS

Comment 2 by ttuttle@chromium.org, Mar 9 2015

Cc: k...@kandrsoft.com
Owner: ttuttle@chromium.org

Comment 3 by bugdroid1@chromium.org, Mar 9 2015

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f379e0e00068336aec9b4b78a49826b424152da

commit 5f379e0e00068336aec9b4b78a49826b424152da
Author: ttuttle <ttuttle@chromium.org>
Date: Mon Mar 09 20:45:23 2015

Revert "Async DNS: Remove toggle from about:flags"

This reverts commit eabf1f5baba38d46921acd6edda594f942f7d6a1.

Removing the toggle in about:flags breaks a workaround for users who
have nonstandard nsswitch configurations for hosts.

Revert the removal until we properly check nsswitch.conf before
assuming a standard configuration.

BUG=117655

Review URL: https://codereview.chromium.org/987133003

Cr-Commit-Position: refs/heads/master@{#319725}

[modify] http://crrev.com/5f379e0e00068336aec9b4b78a49826b424152da/build/ios/grit_whitelist.txt
[modify] http://crrev.com/5f379e0e00068336aec9b4b78a49826b424152da/chrome/app/generated_resources.grd
[modify] http://crrev.com/5f379e0e00068336aec9b4b78a49826b424152da/chrome/browser/about_flags.cc

Comment 4 by ttuttle@chromium.org, Mar 9 2015

Labels: M-41 M-42 Merge-Requested
This is a simple revert of an earlier change that broke non-default DNS configs for some Linux users. I'd like to merge it to stable, beta, and dev.

Comment 5 by amin...@google.com, Mar 9 2015

Labels: -Merge-Requested Merge-Review Hotlist-Merge-Review
[Automated comment] Reverts referenced in bugdroid comments, needs manual review.

Comment 6 by amineer@chromium.org, Mar 10 2015

Labels: -Merge-Review Merge-Rejected
Strings are frozen and this CL adds two new ones which do not appear to be translated in tc/ - as such, merge is rejected.  If we can merge a subset of this patch without the strings feel free to update the bug and re-request a merge.

Comment 7 by cbentzel@chromium.org, Mar 10 2015

Note: I don't think the fix we want here is to bring back about:flags. I think the fix we want is to disable async DNS on Linux until we have an nsswitch.conf workaround.

Comment 8 by szym@chromium.org, Mar 10 2015

I would suggest a fix similar to what is done on Mac: If there's such a custom (but very rare) configuration, then set DnsConfig.unhandled_options = true

See:
https://code.google.com/p/chromium/codesearch#chromium/src/net/dns/dns_config_watcher_mac.cc&sq=package:chromium&type=cs&l=101  (domain-specific resolvers on Mac)
or
https://code.google.com/p/chromium/codesearch#chromium/src/net/dns/dns_config_service_posix.cc&l=481 (TCP-only, etc.)

Comment 9 by ttuttle@chromium.org, Mar 10 2015

Okay, this is gonna be a bit messy; many distros insert mdns_minimal (for Avahi) between files and dns, so even if we just checked for a prefix of "dns files", we'd end up unconfigured on a lot of systems.

I'm checking if we have multicast DNS built in yet. If we do, we *might* be able to deal with those cases.

Comment 10 by szym@chromium.org, Mar 10 2015

The common default which we handle is "files dns" (that is the default on debian/ubuntu too). But yes, avahi inserts mdns_minimal after files.

There IS a multicast querier in net/dns. However, mdns4_minimal means "use mDNS if .local only", which is the same thing DnsClient does. So we handle that and [NOTFOUND=return] too.

Comment 11 by k...@karlwilbur.net, Mar 10 2015

Here's my /etc/nsswitch.conf:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] prax dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

Comment 12 by k...@karlwilbur.net, Mar 10 2015

What I am seeing is that Chrome is bypassing the local DNS resolution stack (nsswitch.conf) and doing direct resolution against 8.8.8.8. This results in all of my .dev domains resolving as 127.0.53.53 from Google's DNS ...which is itself another issue with Google's DNS resolution.

Also, FWIW, without a network connection (unchecking "Enable Networking" in the networking applet, shutting down all interfaces via ifconfig, etc.) Google Chrome will actually resolve the .dev domain names correctly. This is not a very workable workaround though.

Comment 13 by bugdroid1@chromium.org, Mar 11 2015

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1a2a2738522cb00347f277e8e7d725a4e46ed053

commit 1a2a2738522cb00347f277e8e7d725a4e46ed053
Author: ttuttle <ttuttle@chromium.org>
Date: Wed Mar 11 22:06:13 2015

Async DNS: Disable on Linux until we parse nsswitch.conf

Right now, we don't examine nsswitch.conf, but we assume it has a
standard (hosts: files dns) configuration for hostname resolution.

We should check that that's true before activating the internal
resolver, and fall back to the OS resolver if it's not.

In the meantime, however, just disable Async DNS on Linux so it doesn't
break for users with nonstandard configurations.

BUG=117655

Review URL: https://codereview.chromium.org/990063004

Cr-Commit-Position: refs/heads/master@{#320160}

[modify] http://crrev.com/1a2a2738522cb00347f277e8e7d725a4e46ed053/chrome/browser/net/async_dns_field_trial.cc

Comment 14 by bugdroid1@chromium.org, Mar 12 2015

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9687e96365b450552b101213185f32fd382d05f0

commit 9687e96365b450552b101213185f32fd382d05f0
Author: ttuttle <ttuttle@chromium.org>
Date: Thu Mar 12 17:33:17 2015

Revert "Revert "Async DNS: Remove toggle from about:flags""

I'm going to disable it on Linux entirely instead of restoring the flag.

I'll merge that disable to dev/beta/stable, then write a change that
actually examines nsswitch.conf to see if the hosts config is standard.

BUG=117655

Review URL: https://codereview.chromium.org/995833003

Cr-Commit-Position: refs/heads/master@{#320310}

[modify] http://crrev.com/9687e96365b450552b101213185f32fd382d05f0/build/ios/grit_whitelist.txt
[modify] http://crrev.com/9687e96365b450552b101213185f32fd382d05f0/chrome/app/generated_resources.grd
[modify] http://crrev.com/9687e96365b450552b101213185f32fd382d05f0/chrome/browser/about_flags.cc

Comment 15 by lafo...@chromium.org, Oct 7 2015

Labels: Hotlist-Recharge
This issue likely requires triage.  The current issue owner may be inactive (i.e. hasn't fixed an issue in the last 30 days or commented in this particular issue in the last 90 days).  Thanks for helping out!

-Anthony

Comment 16 by ttuttle@chromium.org, Apr 1 2016

Owner: juliatut...@chromium.org

Comment 17 by juliatut...@chromium.org, May 8 2017

Owner: ----

Comment 18 by mge...@chromium.org, May 9 2017

Status: Available (was: Assigned)

Comment 19 by juliatut...@chromium.org, May 9 2017

Owner: mge...@chromium.org

Comment 20 by gavinp@chromium.org, Jul 27 2017

Owner: gavinp@chromium.org
Status: Assigned (was: Available)
claiming this for now

Comment 21 by juliatut...@chromium.org, Nov 20 2017

Owner: mge...@chromium.org

Comment 22 by mge...@chromium.org, Mar 23 2018

Owner: ----
Status: Available (was: Assigned)

Comment 23 by benhenry@google.com, Aug 23

Components: -Internals

Sign in to add a comment