How to add your hosts to OpenWrt?

I have a router on OpenWRT 21.02.2

I need to add my Hosts to the router. [I was interested in the project on Github StevenBlack Hosts]
Just to protect inappropriate information, there is a blocking of Porn, and social networks.

How can I add my Hosts in OpenWRT?

I read the OpenWRT Wiki, looked at the guides on Google, but did not understand how to do it.

help me please

luci-app-adblock can probably use those blocklists.

This is in which section to add your Hosts?

Bottom right tab, Blocklist sources.

1 Like

I did as per your instructions, I found Steven Black, but for some reason nothing is blocked. As it came to the sites, so it comes. Why is that?

screen30

Edit Blacklist

  • Add entries
  • Save
  • Reload

I noticed in the logs that it gives an error downloading Yoyo. Maybe that's why it doesn't work?

Fri Mar 18 08:08:48 2022 user.info adblock-4.1.3[9088]: download of 'yoyo' failed, url: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext, rule: /^([[:alnum:]_-]{1,63}\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}, categories: -, rc: 5, log: Downloading 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml&showintro=0&mimetype=plaintext' Connecting to 213.230.210.231:443 Connection error: Invalid SSL certificate
Fri Mar 18 08:09:35 2022 user.info adblock-4.1.3[9088]: blocklist with overall 47823 blocked domains loaded successfully (Xiaomi Mi Router 4C, OpenWrt 21.02.2 r16495-bf0c965af0)
Fri Mar 18 08:19:06 2022 user.info adblock-4.1.3[10825]: Please enable the 'DNS Report' option to use the reporting feature

No...

To be clear, you want to add your own list of domains to block, correct?

If so, did you add them?

For my own list, I mean Unified hosts + fakenews + gambling + porn by Steven Black.

In the [Blacklist Sources] section, there is exactly the [StevenBlack List Selection] I need, where I can select [Unified hosts + fakenews + gambling + porn] I use this, but I can still go to porn sites.

I don't understand why List selection doesn't work for me

1 Like

Gotcha...

It appear to have worked...did you RELOAD after each addition?

OK, are you using the Blocklist query on the OpenWrt, or testing thru a client?

screen31

Did you enable it (then reload)?

screen33

:spiral_notepad: You will need to clear any client DNS cache.

1 Like

I'm testing through a client, more precisely, through a smartphone connected via openwrt, I visit porn sites.

My task is to make Wi-Fi completely prohibit access to porn sites, and the best choice for me turned out to be [Unified hosts + fakenews + gambling + porn]

I'm sorry if I misunderstood you, because I communicate through Google translator

What language?

Troubleshooting information was provided.

Russian

Could it be that yoyo did not start in the logs, and because of this it ignores Hosts?

...

Пожалуйста, ознакомьтесь с шагами по устранению неполадок, описанными выше, для проверки с маршрутизатора.

Please see the troubleshooting steps above to test from the router.

Нет

No.

Протестируйте, отключив йойо

Test by disabling yoyo.

are you sure the client is using the router's DNS server? adblock by default adds rules to router's dns server and if a client is using a different one obviously adblock will not filter out anything.

you can enable Force Local DNS option which will redirect any DNS query attempt to alternative DNS servers to router.

please note: this redirection may not work if client has hardcoded dns (many mobile device and or application using vendor's dns server, e.g. directly going to google), or if client using for example secure dns (e.g. DNS over HTTPS) like Firefox, Chrome by default using cloudflare.com for DNS resolution independently from your general LAN configuration.

2 Likes

Added StevenBlack to the list, turned off the yo-yo. It didn't work at first, then it seemed to work.
By the way, Trigger interface can choose LAN? The default is WAN.


If you don't have an alternative internet interface, leave it to wan.

Something wrong with the certificate of the yoyo source.

1 Like

I'm stupid. Now I connected my WireGuard configured through VPS, and all sites began to open.
It is necessary to briefly configure Steven Black on the VPS itself, and then connect WireGuard to OpenWRT itself

I also want to set up pi-hole on VPS and make it work on WireGuard

I also want to set up ipv6, since my provider only supports ipv4. :thinking: