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: ----
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug

Sign in to add a comment

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

Reported by, 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, Mar 10 2013

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

Comment 2 by, Mar 9 2015


Comment 3 by, Mar 9 2015

Project Member
The following revision refers to this bug:

commit 5f379e0e00068336aec9b4b78a49826b424152da
Author: ttuttle <>
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.


Review URL:

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


Comment 4 by, 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, Mar 9 2015

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

Comment 6 by, 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, 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, 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:  (domain-specific resolvers on Mac)
or (TCP-only, etc.)

Comment 9 by, 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, 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, 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, Mar 10 2015

What I am seeing is that Chrome is bypassing the local DNS resolution stack (nsswitch.conf) and doing direct resolution against This results in all of my .dev domains resolving as 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, Mar 11 2015

Project Member
The following revision refers to this bug:

commit 1a2a2738522cb00347f277e8e7d725a4e46ed053
Author: ttuttle <>
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.


Review URL:

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


Comment 14 by, Mar 12 2015

Project Member
The following revision refers to this bug:

commit 9687e96365b450552b101213185f32fd382d05f0
Author: ttuttle <>
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.


Review URL:

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


Comment 15 by, 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!


Comment 16 by, Apr 1 2016


Comment 17 by, May 8 2017

Owner: ----

Comment 18 by, May 9 2017

Status: Available (was: Assigned)

Comment 19 by, May 9 2017


Comment 20 by, Jul 27 2017

Status: Assigned (was: Available)
claiming this for now

Comment 21 by, Nov 20 2017


Comment 22 by, Mar 23 2018

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

Comment 23 by, Aug 23

Components: -Internals

Sign in to add a comment