I am writing python code that will do some restapi connections to some hosts. I need to map a specific hostname to specific ip address. But i have to set it globally because in there are several configurations with this hostname. In my scripts whenever this hostname is called i need it to be mapped to that ip. Like setting this mapping in hosts file in OS. But i dont want to set this mapping in hosts file. I want to set it globally in my scripts. I also want this mapping to be dominant to hosts file and dns. Script will not check dns or hosts file for this mapping and will use this global mapping.
0
votes