Change History (16)

I am not using such an extreme hosts file, but I use one since forever, and it's working just fine for me. I would expect that Haiku (or rather BIND) may have problems with that particular hosts file, though.

I am not using such an extreme hosts file, but I use one since forever, and it's working just fine for me. I would expect that Haiku (or rather BIND) may have problems with that particular hosts file, though.

I have used the same hosts file for years on Windows2k, WinXP, Vista, Ubuntu 8.04 and up, PC-BSD 7 and up, and Haiku. Haiku has always failed to utilize the host file. The size of the hosts file should not matter, it should just work.

This is essentially the same as ticket:3639, only that was from before the beos->system renaming.

Currently, I have the same hosts file in boot/common/settings/network and boot/common/etc and it is still not utilized. I have never experienced Haiku respecting any hosts file, regardless where it was placed.

The hosts file works after being converted to unix line endings, but the resolver appears to always check dns first. If I move my resolv.conf file out of the way then these hosts will resolve to 127.0.0.1

The hosts file works after being converted to unix line endings, but the resolver appears to always check dns first. If I move my resolv.conf file out of the way then these hosts will resolve to 127.0.0.1

I moved the /common/settings/network/reslv.conf to the desktop and rebooted, but my hosts file did not seem to work.

The hosts file works after being converted to unix line endings, but the resolver appears to always check dns first. If I move my resolv.conf file out of the way then these hosts will resolve to 127.0.0.1

I confirm that's the normal behavior.
The default order for hosts resolution by IRS's libbind.so used in Haiku is:

Domain Name Server (DNS)

Network Information Service (NIS), if active

local (aka hosts file)

As the host names in this anti-ads/spams hosts file are all resolved by DNS first, it doesn't work as one will expect.

To change that, you must create an /etc/irs.conf as follow:

hosts local dns

Beware, considering the size of this hosts file, it could make *all* host name resolution a bit slower. And there is no system-wide cache, only a per-application cache.

Sadly, we didn't fixed this path, which should lives in /common/settings/network/irs.conf instead. I will do that eventually, except if someone else does it faster than me.

I don't know why you would want a local hosts file checked last. On pretty much every operating system I've used you can add to a hosts file to override something out on the internet. This adblock host file is one example, but in my work I've also used it to make external websites I was testing resolve to a local host when testing things. I think we should either add a default irs.conf to the system to force local host resolving first or better yet override the defaults within the library.

It is pretty ridiculous for the DNS library to choke on Windows line endings. The line ending should be irrelevant when parsing the hosts file. Haiku is not the sort of system where stupid things like that should break functionality.

There should be a system-wide DNS cache, and everything in the hosts file should be pre-cached. Resolving DNS should not be adversely affected by even a hosts file as big as this one (559 KB.)

I have no idea about irs.conf and other details commented in this ticket, but a hosts file works indeed. Much faster web browsing without all those ads everywhere, too. I also tried the hosts file attached to this ticket; it works as well. Close ticket?