EDIT
I managed to find out what I was missing that made it clear how to fix my problem. Turns out that between 16.04 and 18.04, Ubuntu and derivatives switched from something dnsmasq based to something systemd-resolved based by default and systemd-resolved is much less willing than dnsmasq to tollerate hundreds of thousands of lines in /etc/hosts
.
Below is the original question as I tried to describe it, I'm just adding this about there being an answer here while I'm on the edit page anyway because I figured I should fix the tags to better reflect what turned out to be the relevant components.
Original Post
So, I recently moved from xenial (16.04) to bionic (18.04), and I've been mostly successful at resolving at least the kinks that I think have a resolution. I think I'm down to one last thing that's not as I'd prefer it that I expect there to be a fix to.
In 16.04, I used to have a nice lengthy hostfile to just not even load known malicious sites. It worked well enough for me, if anything broke I could just check and see if the relevant domain was there, check how it got there, and make my own decisions about whether to un-blacklist it.
I tried to migrate over my hostfile from my old drive with 16.04 on it, but then suddenly nothing would load so I had to revert. After comparing a little bit, I found one tiny difference (my new hostfile included two versions of my computer's hostname, one ending in ".lan") and tried correcting that to see if it would fix things. No dice.
I can add items to the list, if I copy over my shortlist of domains I just don't want loading those get blocked fine, but when I add the massive list that used to work it seems to make DNS take forever and never resolve anything. This is the same list of hosts that I had added this same way just fine a few days ago.
My best thought on where I would try to begin with this is to look further into whatever changes happened to networking between xenial and bionic (I had to wrestle control back over my modern-name-of-eth0 because something new was trying to auto-manage it), but it took me some time to even find a guide that successfully got me control back over my wired network and I'm honestly not even sure what the entire scope of the changes are.
Does anyone else use a hostfile to just block a bunch of domains and happen to know what's going on here? Is there some setting that the default got changed and it impacts hostfile parsing and I need to set it to the old setting or something? I'd be more suspicious of the file itself, but that it was working just fine under xenial has me fairly certain that a change in bionic is relevant and it's not just that the hostfile itself is wrong (or if it is, it's wrong in a way that has historically worked, I've been using the same source since precise).
/etc/hosts
so they don't load. Sorry, I feel like in some context before I've heard of that file just being generally referred to as the "hostfile" (or maybe "hostsfile"?), I probably should have spelled out that I do specifically mean/etc/hosts
. – Turnip Wizard Sep 02 '19 at 18:25sudo mv /etc/hosts /etc/host
? Are the sites being blocked still so? – Paul Benson Sep 02 '19 at 19:59I'm afraid I don't understand the question?
– Turnip Wizard Sep 02 '19 at 21:03