Q: Why do you want to change /etc/hosts and /etc/resolv.conf (besides hacking DNS for testing purposes)?
e.g.
10.0.12.34 mysql_host
This allows some degree of flexbility1. boot up new instances quickly as long as HOSTS is correct
2. Don't have to hard-code actual mysql server IPs.
3. Make mysql master/slave failover much easier.
It seems that most issues OP have is mostly because misunderstanding or lack of knowledge.
In this scenario I dont control the dns server and the app reeally likes aliases instead of IPs.
In the end, we just created configuration files for it, as more often then not, there are other factors that need to be included.
That said, maybe these requirements are being set by applications that are not yours to mess around with.
In which case, may god have mercy on your soul.
If you are unit testing DNS infrastructure, shouldn't you mock DNS things?