provide a way to map all dns to constant (probly localhost)

RESOLVED FIXED in Firefox 55

Status

()

Core
Networking: DNS
RESOLVED FIXED
7 months ago
7 months ago

People

(Reporter: mcmanus, Unassigned)

Tracking

50 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

7 months ago
// When non empty all non-localhost DNS queries (including IP addresses)
// resolve to this value. The value can be a name or an IP address.
// domains mapped to localhost with localDomains stay localhost.
pref("network.dns.forceResolve", "");

Testing is the primary use case here - replay captive data on a 'fake server' by directing all traffic to it at the DNS level. Chrome has something similar.
(Reporter)

Comment 1

7 months ago
does this meet the immediate need?
Flags: needinfo?(benjamin)
Comment hidden (mozreview-request)

Comment 3

7 months ago
Yes, I believe this meets the immediate need.
Flags: needinfo?(benjamin)

Comment 4

7 months ago
mozreview-review
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138174

::: netwerk/dns/nsDNSService2.cpp:718
(Diff revision 1)
>          return NS_OK;
>      }
>  
> +    if (mForceResolveOn) {
> +        MutexAutoLock lock(mLock);
> +        if (!IsASCII(aInput) ||

It's not clear why the input needs to be non-ascii, based on the patch description.
Attachment #8863417 - Flags: review?(valentin.gosu) → review+

Comment 5

7 months ago
mozreview-review
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138178

Also, the win10 try is all orange. It might be because the test failed, and the pref didn't get cleared?
do_register_cleanup would be the proper way to fix it.

::: netwerk/test/unit/test_dns_service.js:12
(Diff revision 1)
>    onLookupComplete: function(inRequest, inRecord, inStatus) {
>      var answer = inRecord.getNextAddrAsString();
>      do_check_true(answer == "127.0.0.1" || answer == "::1");
>  
> +    nextTest();
>      do_test_finished();

I think the test might become racy. Leave in just one do_test_pending() in run_test(), and move do_test_finished() to testsDone
Comment hidden (mozreview-request)
(Reporter)

Comment 7

7 months ago
mozreview-review-reply
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138178

the non win-10 problem is because there is a "wrapper" for that test I forgot about that tries to run it in content (the main one ones in chrome).. which is ok for the feature, but not for the test which sets prefs.

after fixing that in rev2 win10 is still a disaster, but the other platforms look ok. I don't believe the test is racy and causing impacts beyond xpcshell - those test suites are clearly new sessions.

so either the patch is busted or it is based on something busted. hmm.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Reporter)

Comment 10

7 months ago
mozreview-review-reply
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138174

> It's not clear why the input needs to be non-ascii, based on the patch description.

rev3
(Reporter)

Comment 11

7 months ago
mozreview-review-reply
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138178

the diff between r3 and r4 is a rebase - no other changes. fyi
(Reporter)

Comment 12

7 months ago
mozreview-review-reply
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138178

it seems quite likely that win10-taskcluster is just not working.. see https://treeherder.mozilla.org/#/jobs?repo=try&revision=b0fac48a0a88b8b0aa716fbf431fec44a6d7c640 which is unrelated to this bug but looks very similar.

I'll rerun with a more traditional try syntax
(Reporter)

Comment 13

7 months ago
mozreview-review-reply
Comment on attachment 8863417 [details]
Bug 1361099 - provide a way to map all dns to constant

https://reviewboard.mozilla.org/r/135180/#review138178

> I think the test might become racy. Leave in just one do_test_pending() in run_test(), and move do_test_finished() to testsDone

I don't see any evidence it is racy.. pending/finsished work as semaphores and test2 is declared pending before test1 is marked finished (its part of the work of test1)

Comment 14

7 months ago
Pushed by mcmanus@ducksong.com:
https://hg.mozilla.org/integration/autoland/rev/c76bc8652af1
provide a way to map all dns to constant r=valentin

Comment 15

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c76bc8652af1
Status: NEW → RESOLVED
Last Resolved: 7 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.