How to mannually resolve domain names in a NixOS live CD?

Nixpkgs binary caches and some of the upstream sources are badly connected in my locale, partly due to DNS pollution. In a running system, this can be eased by specifying IP addresses for the domain names mannually in the NixOS option networking.hosts. But when installing NixOS via a live CD, the configuration.nix of the installation media itself seems to be incomplete and do not really take effect. So should I set them in /etc/hosts like in a normal distribution, or is there any other method to meet my needs?

How are you manually resolving those DNS names in order to create the hosts entries?

Would it make sense, instead, to create a customer Installer ISO that is configured to use your own trusted/reliable DNS servers?

Otherwise, you could create a custom installer iso with the hosts entries set, but then what if those entries go stale?

Other-otherwise, I’d probably do something like this, to statefully modify /etc/hosts on the fly in the installer, despite it feeling a bit hacky:

sudo cp /etc/hosts /etc/hosts_
sudo rm /etc/hosts
sudo mv /etc/hosts_ /etc/hosts
sudo nano /etc/hosts