Hosts: [dnsmasq] bad address when reading the lists

Created on 17 Apr 2018  路  8Comments  路  Source: StevenBlack/hosts

@StevenBlack i was looking at dnsmasq's logs and it was showing bad address on line 8 which is this: "fe80::1%lo0 localhost" line. I thought you should know.Thanks.

dnsmasq[567]: bad address at /media/AiDisk_a1/Hosts/add.hosts line 8
dnsmasq[567]: read /media/AiDisk_a1/Hosts/add.hosts - 57123 addresses

Most helpful comment

@dnmTX, I literally JUST made this for you, so it's a bit rough. It just does individual files, but it will be easy enough to allow you to compress directories in the future.

https://github.com/ScriptTiger/Hosts-Compressor

I got a bit tired of putting off your ideas and this one was a short one anyway. You really do have a lot of great ideas for simple utilities I think others would find useful, my offline repos are mounting. Feel free to open an issue there and let me know your feedback. I know it's totally messy at the moment, but I'll clean it up when I have time and add some more features.

P.S.: Check the top "set" lines for custom settings.

rem Blackhole address for source file
set FROM_BLACKHOLE=0.0.0.0

rem Blackhole address for resultant file
set TO_BLACKHOLE=0.0.0.0

rem Compression from 1 to 9 domains per line
set COMPRESSION=9

P.S.P.S.: And, yes, I do update all of the content on my entire site regularly and you can check the feed on the right-hand side to see when, and I also just started posting to Twitter to make it easier to get mobile alerts.

All 8 comments

How are you generating your dnsmasq file? None of the following lines should be on a server-side blacklist implementation (DNS server, dnsmasq, proxy server, network firewall, pfSense, etc.):

127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.0.1 local
255.255.255.255 broadcasthost
::1 localhost
::1 ip6-localhost
::1 ip6-loopback
fe80::1%lo0 localhost
ff00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
0.0.0.0 0.0.0.0

Those lines are specifically for end-user devices and cannot be distributed over a server protocol. If you use the lists on my website, it filters those and other problem lines out for servers.
https://scripttiger.github.io/alts/

@ScriptTiger i'm not generating it because if i do it has to be .config file and has to go in the same directory where dnsmasq is installed but due to limited space(remember i mention it in the other thread?) i'm just fetching the @StevenBlack 's lists to a USB drive connected to the router with .hosts extension and then pointing dnsmasq to read the file with "addn-hosts=" command and it's working.The thing is i'm very limited on options,unless you have better idea.....?
P.S. What i saw also is that the main hosts file that dnsmasq is programmed to read from has "127.0.0.1 localhost" in it already so i don't thing that the lines mentioned above creating any problems in general for dnsmasq.

If your limit is 8 mb, it should still be enough for even the largest blacklist, which is 2.5 mb with all extensions in dnsmasq format. But then again I also don't know how much room your custom OS is using. However, If your current setup is fully compatible with the hosts file format, you can use the compressed formats and just omit the lines I mentioned above and that should free up more space to help it run faster. Manually deleting them should be easy enough because they're always together at the top, but you could also script it relatively easily using the whitelist functionality to ignore those lines. If you do it that way, it takes the largest blacklist with all extensions in hosts file format down to 1.4 mb.

Can you install dnsmasq on a host machine rather than on the router which has more limitations?

In any case, this is a software-specific issue and not a problem with Steven Black's files. We just need to figure out how to get it to work in your particular case.

I'll just leave it as it is for now cause as you said it has nothing to do with the lists here or even dnsmasq but my router and it's limitations.Don't have another pc to load it there but i'll try to fetch one of your compressed ones to see if it make any difference and i'll let you know.About removing the lines with the script,i have no idea how to do it and if it's too much trouble don't even bother man.I don't think it's worth the time or the effort.Thanks for the help @ScriptTiger ,very much appreciate your willingness to help.
Closing.......

@ScriptTiger i got it man.....took a while but I GOT IT 馃槂 . So...i'm fetching one of your "mcompressed" lists and i hope those lists are updated on time(please confirm),removed all those lines mentioned earlier by you along with the comments(PURE JOY 馃槑).Also fetching additional list for the windows telemetry from another repo and i can really use your help to figure how to compress it(5 lines).This is the final script so far,tested,working fine:

!/bin/sh

wget https://scripttiger.github.io/alts/mcompressed/blacklist-fg.txt -O /media/AiDisk_a1/Hosts/hosts.txt
wget https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt -O /media/AiDisk_a1/Hosts/windows.txt
sed -i '/#/d; /255/d; /127/d; /::1/d; /ff00/d; /ff02/d; /0.0.0.0 0.0.0.0/d' /media/AiDisk_a1/Hosts/hosts.txt
sed -i '/#/d; /^$/d' /media/AiDisk_a1/Hosts/windows.txt
killall dnsmasq
/usr/sbin/dnsmasq

P.S. Any help with how to compress the windows list will be appreciated.Thank you.

@dnmTX, I literally JUST made this for you, so it's a bit rough. It just does individual files, but it will be easy enough to allow you to compress directories in the future.

https://github.com/ScriptTiger/Hosts-Compressor

I got a bit tired of putting off your ideas and this one was a short one anyway. You really do have a lot of great ideas for simple utilities I think others would find useful, my offline repos are mounting. Feel free to open an issue there and let me know your feedback. I know it's totally messy at the moment, but I'll clean it up when I have time and add some more features.

P.S.: Check the top "set" lines for custom settings.

rem Blackhole address for source file
set FROM_BLACKHOLE=0.0.0.0

rem Blackhole address for resultant file
set TO_BLACKHOLE=0.0.0.0

rem Compression from 1 to 9 domains per line
set COMPRESSION=9

P.S.P.S.: And, yes, I do update all of the content on my entire site regularly and you can check the feed on the right-hand side to see when, and I also just started posting to Twitter to make it easier to get mobile alerts.

Thank you @ScriptTiger for making the script and taking the time to do it.Let me see how it's going to work and i'll move to your repo for further assistance,i think @StevenBlack had enough of me cluttering here 馃構.Soryyyyy !

@dnmTX #notaproblem 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikhoul picture mikhoul  路  3Comments

TheGroundZero picture TheGroundZero  路  3Comments

bsd-source picture bsd-source  路  3Comments

dhavalgoti24 picture dhavalgoti24  路  3Comments

RaydenX93 picture RaydenX93  路  3Comments