How to set up a host to IP mapping on unrooted Android?
You cannot simply edit the hosts file on Android, as it resides on a read-only file system: /system/etc/hosts, see:


How to edit etc/hosts file
How to change the hosts file on android


Alternatives are:


use a DNS server like DNSMasq in your local network to take care for that "centrally"
use "root powers" to force-edit the system file as described above
install a "local DNS server" on your Android device to use that, e.g. DNS Server