Pale Moon ignores /etc/hosts

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
peter

Pale Moon ignores /etc/hosts

Unread post by peter » 2018-01-07, 19:59

Hi,
its looking like an old firefox bug: Pale Mone ignores my hosts.

ping and shell are using the host file.

my file:

Code: Select all

127.0.0.1	localhost
The browser is using a search engine instead.

Greetings

John connor

Re: Pale Moon ignores /etc/hosts

Unread post by John connor » 2018-01-08, 02:10

I don't understand what you are saying. Can you be a little more descriptive?

User avatar
SpockFan02
Astronaut
Astronaut
Posts: 535
Joined: 2017-09-24, 16:35
Location: Mak pupulusšum, California

Re: Pale Moon ignores /etc/hosts

Unread post by SpockFan02 » 2018-01-08, 05:18

John connor wrote:I don't understand what you are saying. Can you be a little more descriptive?
It sounds like they've got something set in their hosts file (like a DNS override—I'm not sure of the correct terminology), but they can't access it because Pale Moon doesn't recognize it as an address and thinks it's a search query.

New Tobin Paradigm

Re: Pale Moon ignores /etc/hosts

Unread post by New Tobin Paradigm » 2018-01-08, 07:07

so are you typing just 'localhost' in the location bar or 'http://localhost/' ?

John connor

Re: Pale Moon ignores /etc/hosts

Unread post by John connor » 2018-01-08, 08:47

SpockMan02 wrote:
John connor wrote:I don't understand what you are saying. Can you be a little more descriptive?
It sounds like they've got something set in their hosts file (like a DNS override—I'm not sure of the correct terminology), but they can't access it because Pale Moon doesn't recognize it as an address and thinks it's a search query.
In that case it could be that the website doesn't answer to that direct IP. I don't know.

New Tobin Paradigm

Re: Pale Moon ignores /etc/hosts

Unread post by New Tobin Paradigm » 2018-01-08, 09:25

You know, John connor .. If you have no idea what is going on.. Then why are you in this thread?

Anyway, when the OP gets back to this thread, I await his answer because if it is the former and not the latter.. That simply isn't going to work.. The location bar goes through several steps to try and get you where you are trying to go.. One of the last steps by default is to send it to search engine..

Now the intermediate steps when you don't write out an fully qualified address is matching to 'domain.tld' obviously 'localhost' does not match a pattern of 'domain.tld'. To bypass the step for keyword (or search term) detection and use an extensionless domain name as defined by a dns server or in this case, hosts.. You have to use a fully qualified address.. Hince, 'http://localhost/'. An additional matching would happen if has a slash at the end or a slash with a uri.. Basically, 'localhost/' or 'localhost/index.html' will be detected as an address and the browser will perform additional fix up.. Like adding the protocol scheme...

So, assuming the former is happening instead of the latter from my original question to the OP.. Pale Moon is NOT ignoring your hosts file... You are simply not aware of how Pale Moon handles non-fully qualified addresses and SpockMan02 is correct but it wasn't the entire story. Still, good on him!

But I await a response.
Last edited by New Tobin Paradigm on 2018-01-08, 09:39, edited 4 times in total.

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Pale Moon ignores /etc/hosts

Unread post by adesh » 2018-01-08, 09:40

peter, if you changed "/etc/hosts" while Pale Moon was running, you may need to restart the browser or wait a few minutes before it picks up changes automatically.

Also, as Tobin pointed out typing just "localhost" would, of course, make the browser perform a search. Just adding a slash, i.e. typing "localhost/", would do the trick for you.

John connor

Re: Pale Moon ignores /etc/hosts

Unread post by John connor » 2018-01-08, 14:45

New Tobin Paradigm wrote:You know, John connor .. If you have no idea what is going on.. Then why are you in this thread?

Who the hell said I was talking to you!

Based on what SpockMan02 said, I was implying what might be the cause of the problem. But the damn OP hasn't even responded yet, so who knows what the hell he's asking about.

My thought is that he's added a line in hosts to redirect to a website and that the IP doesn't resolve to that link directly. That's it!

I'm not stupid. I have used and use the hosts file all the time. Especially to temp bypass Cloudflare that's enabled on my site when I need to isolate an issue.
Last edited by John connor on 2018-01-08, 14:49, edited 4 times in total.

John connor

Re: Pale Moon ignores /etc/hosts

Unread post by John connor » 2018-01-08, 14:53

If it's a matter of wanting to go to home sweet home, then enter 127.0.0.1 or http:\\localhost\ But that doesn't make any damn sense. Why call localhost? What is it that you are doing?

Inquiring minds want to know. :lol:
Last edited by John connor on 2018-01-08, 14:54, edited 2 times in total.

peter

Re: Pale Moon ignores /etc/hosts

Unread post by peter » 2018-01-08, 15:03

John connor wrote: My thought is that he's added a line in hosts to redirect to a website and that the IP doesn't resolve to that link directly. That's it!
I run a local webserver at 127.0.0.1/80 and want to call it with localhost or some other names. So ive put the line in the hosts file.
Firefox, ping etc. are using the file. Pale Moon dont. Also with reboot.
New Tobin Paradigm wrote:so are you typing just 'localhost' in the location bar or 'http://localhost/' ?
Thats it! I did the first, and now the second thing. After that, boths is working. Thank you
Last edited by peter on 2018-01-08, 15:04, edited 2 times in total.

John connor

Re: Pale Moon ignores /etc/hosts

Unread post by John connor » 2018-01-08, 15:07

Odd, because when I run Xampp, I just enter localhost/mywebsite. No messing with the hosts file at all.

Hosts file is more or less a way to bypass DNS. Or you can use it to prevent things from making a connection. The old and cumbersome way of blocking ADs. :lol:

127.0.0.1/80
This is a very odd CIDR. :D
Last edited by John connor on 2018-01-08, 15:10, edited 2 times in total.

New Tobin Paradigm

Re: Pale Moon ignores /etc/hosts

Unread post by New Tobin Paradigm » 2018-01-08, 16:36

Off-topic:
John connor wrote:Who the hell said I was talking to you!
Welp.. I tried.. A shame really.. Oh well.

As an addendum.. When you post on a public forum.. Expect anyone to start addressing you.. Or do you actually believe that you can have a private one-on-one conversation on a public forum. Surprise, it doesn't work that way.. Also, I shall speak to anyone I see fit no matter if they were talking to me or not.

I only asked, why you were posting in a thread when you have no idea, and I actually did, of what was going on or possibly what was going on. Just because someone posts something and you read it, it does not mean they were talking to you.. "I don't know posts" are not helpful and that is what your post was.. At most it contained only a thinly veiled request for clarification.. Perhaps, you should reconsider how you respond to such situations.
John connor wrote:I'm not stupid.
K.
Last edited by New Tobin Paradigm on 2018-01-08, 16:38, edited 1 time in total.

doffen

Re: Pale Moon ignores /etc/hosts

Unread post by doffen » 2018-01-09, 03:09

Please mind your language, gentlemen!

New Tobin Paradigm

Re: Pale Moon ignores /etc/hosts

Unread post by New Tobin Paradigm » 2018-01-09, 10:08

doffen wrote:Please mind your language, gentlemen!
https://forum.palemoon.org/app.php/rules#foul-language wrote:Please mind your language. No excessive swearing or cursing.
Although we will not be policing your use of language, since everyone here is assumed to be of an adult and tolerant mindset, and using swear words here and there is just fine, we will take action if your use of such language is excessive, uncalled-for, or otherwise considered by staff to not be suited for general public digestion.
So unless it is a special case like a syndicated or global announcement a couple of hells and a damn doesn't mean shit dude..

However, we ALL at this point should be mindful of the rules about staying on topic.. So let's do that. ;)
Last edited by New Tobin Paradigm on 2018-01-09, 10:08, edited 1 time in total.

BenFenner
Astronaut
Astronaut
Posts: 588
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Pale Moon ignores /etc/hosts

Unread post by BenFenner » 2018-01-09, 15:48

I've been using a handful of hosts file entries here at work to make sure I don't visit sites by habit that I'd prefer to access only at home.
I tested one just now, and Pale Moon is still respecting the hosts file.

I will say one other thing though, in case this matters.
I always set up the Pale Moon location bar to "do one thing, and do it well". I turn off all search capability of the location bar (mine doesn't search bookmarks, the web, etc.) and then I turn off 'keyword' capability in about:config, as well as any prefix or suffix malarkey that it wants to try to add. If I wanted a "www." in front of my requested location I'd have typed it. If I want a ".com" at the end of my requested location I'd have typed that in too.

So, to summarize, my hosts file is being honored (but it might be because of default "features" I've turned off).

New Tobin Paradigm

Re: Pale Moon ignores /etc/hosts

Unread post by New Tobin Paradigm » 2018-01-09, 17:29

It isn't EVEN a matter of it being honored by Pale Moon.. The NETWORKING Stack of the OS is what respects hosts or not.. Not Pale Moon. So this entire honor/dishonor/ignores question is wrong in its very concept. Address fixup, keywords, and search are expected functions for a web browser for the past 10+ years.. Of course it is getting worse in more "Modern" browsers but whatever.. But as you said, you can switch them off.. But you cannot blame mechanisms meant to help users who can't be bothered to type a fully qualified address from fucking up in an edge case like accessing localhost or a resource that doesn't follow public internet address structure of 'domain.tld'.

Locked