AdAway is an open source ad blocker for Android using the hosts file. adaway.org/

An ad blocker that uses the hosts file. The hosts file contains a list of mappings between hostnames and IP addresses. When an app requests an ad, that request is directed to 127.0.0.1 which does nothing. There are options to run a web server to respond to blocked hostnames and to direct requests to the IP address of your choosing. You can download hosts files from the app but it is possible to use your own and to add certain sites to the white- and black-lists.

Requires root as the hosts files is located in /system which is normally read-only.
From version AdAway 4.2.9:
All versions
October 9, 2019
August 9, 2019