Closed Bug 1361099 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: Networking: DNS, defect)

50 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mcmanus, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

// 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.
does this meet the immediate need?
Flags: needinfo?(benjamin)
Yes, I believe this meets the immediate need.
Flags: needinfo?(benjamin)
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 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 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 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
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
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
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)
Pushed by mcmanus@ducksong.com:
https://hg.mozilla.org/integration/autoland/rev/c76bc8652af1
provide a way to map all dns to constant r=valentin
https://hg.mozilla.org/mozilla-central/rev/c76bc8652af1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: