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

RESOLVED FIXED in Firefox 55

Status

()

RESOLVED FIXED
2 years ago
2 months ago

People

(Reporter: mcmanus, Unassigned)

Tracking

(Blocks: 1 bug)

50 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years 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

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

Comment 3

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

Comment 4

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c76bc8652af1
Status: NEW → RESOLVED
Last Resolved: 2 years 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.