How to permanently block sites on android and iphones?

How to permanently block sites on android and iphones?

In windows, if you open:
Windows > system32 > drivers > etc > “hosts” file
SEMrush

and put a line like this:
127.0.0.1 somesite.com

then this somesite.com is blocked on windows.
No browser will be able to open it.

Is there a similar hack available for android phones and apple IOS?

Basically I want to block adult type websites on phones of children.
All I am able to find is solutions where you can block them in chrome/safari browsers etc.
But children can download some other browser app and use that as easily.. to access these sites.
Thanks