본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

localhost dns

more options

I am migrating my wordpress based website to a new computer with a LEMP stack on Ubunto 20.04. I wish to access and test the website using the firefox browser offline. I have modified my local dns (/etc/hosts) file to include my site's url but firefox can't find it. Firefox manages to find the nginx greeting and it finds phpmyadmin which is used to manage my database, but it can't locate the wordpress web pages.

One might think I had a problem with my nginx server blocks, but that's not the case because google chrome finds the web pages with no problem.

FIrefox appears to reach out to the internet dns by default and ignore the localhost dns settings. So how do I change Firefox's default settings so that it can access websites on the same computer like Google Chrome does?

I am migrating my wordpress based website to a new computer with a LEMP stack on Ubunto 20.04. I wish to access and test the website using the firefox browser offline. I have modified my local dns (/etc/hosts) file to include my site's url but firefox can't find it. Firefox manages to find the nginx greeting and it finds phpmyadmin which is used to manage my database, but it can't locate the wordpress web pages. One might think I had a problem with my nginx server blocks, but that's not the case because google chrome finds the web pages with no problem. FIrefox appears to reach out to the internet dns by default and ignore the localhost dns settings. So how do I change Firefox's default settings so that it can access websites on the same computer like Google Chrome does?

선택된 해결법

I assume you also tried completely disabling DNS over HTTPS, and that Firefox is not using a proxy? You can check those settings here:

  • Linux: "3-bar" menu button (or Edit menu) > Preferences
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Windows: "3-bar" menu button (or Tools menu) > Options
  • Any system: type or paste about:preferences into the address bar and press Enter/Return to load it

In the search box at the top of the page, type proxy and Firefox should filter to the "Settings" button, which you can click.

The default of "Use system proxy settings" piggybacks on your Windows/IE "LAN" setting. "Auto-detect" can lead to a flaky connection. You may want to try "No proxy".

The DNS-over-HTTPS checkbox is further down in that dialog.

After closing out of that, clear Firefox's web cache and DNS cache.

Any improvement?

문맥에 따라 이 답변을 읽어주세요 👍 0

모든 댓글 (6)

more options

Hi, if you are using DNS over HTTPS, then Firefox 83.0 should check the hosts file, but perhaps that isn't fully baked yet. You may need to add the relevant host names to the exceptions list, or turn off DNS over HTTPS.

Some settings you might look at:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box in the page, type or paste TRR and pause while the list is filtered

  • network.trr.exclude-etc-hosts => true to read hosts and use it to override the cloud DNS
  • network.trr.excluded-domains => list of hosts that require a local DNS lookup (comma-separated list like intranet,jukebox,dev.mysite)
more options

Unfortunately, listing the website url's in network.trr.excluded-domains does not work on my server. I also tried it with network.trr.exclude-etc-hosts set to false with no luck.

My understanding is that setting network.trr.exclude-etc-hosts to true prevents the resolver from using /etc/hosts in resolving the location. Setting it to false should allow it to include /etc/hosts in resolving the location, but apparently it does not.

For developers, this is a serious shortcoming in Firefox for which there appears to be no excuse.

more options

선택된 해결법

I assume you also tried completely disabling DNS over HTTPS, and that Firefox is not using a proxy? You can check those settings here:

  • Linux: "3-bar" menu button (or Edit menu) > Preferences
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Windows: "3-bar" menu button (or Tools menu) > Options
  • Any system: type or paste about:preferences into the address bar and press Enter/Return to load it

In the search box at the top of the page, type proxy and Firefox should filter to the "Settings" button, which you can click.

The default of "Use system proxy settings" piggybacks on your Windows/IE "LAN" setting. "Auto-detect" can lead to a flaky connection. You may want to try "No proxy".

The DNS-over-HTTPS checkbox is further down in that dialog.

After closing out of that, clear Firefox's web cache and DNS cache.

Any improvement?

more options

wrknight said

I also tried it with network.trr.exclude-etc-hosts set to false with no luck. My understanding is that setting network.trr.exclude-etc-hosts to true prevents the resolver from using /etc/hosts in resolving the location. Setting it to false should allow it to include /etc/hosts in resolving the location, but apparently it does not.

No, you need to keep it set to true if you want Firefox to read your hosts file and exclude hosts listed in that file from DNS over HTTPS resolution.

more options

I had previously set no proxy with no effect, but disabling DNS over HTTPS did the job.

I guess my final question is why did Mozilla have to make it so difficult?

Many thanks.

more options

The purpose of DNS over HTTPS is to bypass local name resolution; local resolution is used only as a fallback in case the address is not found in public DNS.

Firefox 83 is the first version configured to read the hosts file as an override, and that should be on by default. If that doesn't work with your server's host name, you could file a bug and see whether they can sort out why not:

https://bugzilla.mozilla.org/