Check out example codes for "where is the hosts file in windows 10". It will help you in understanding the concepts better.

Code Example 1

Windows 10 and Windows 8 = c:\Windows\System32\Drivers\etc\hosts

Learn ReactJs, React Native from akashmittal.com