3 ms·
As I said I do it at the network level, but every OS should handle that anyway at the OS level as well (though I don't know off the top of my head if/how more l
by xoa 3y ago
As I said I do it at the network level, but every OS should handle that anyway at the OS level as well (though I don't know off the top of my head if/how more locked down stuff like iOS exposes it). No need for any scripting yourself it's just basic functionality. On Unix-like (including macOS) you should generally be able to do it just by adding entries to /etc/resolver (if you're running a full recursive DNS locally obviously just modify that same as on another system). So a plain
cat 'nameserver 192.168.1.1' > /etc/resolver/some.mydomain.com
Would then tell any requests for some.mydomain.com to resolve through 192.168.1.1 (locally). In this case specifically it'd be
cat 'nameserver 8.8.8.8' > /etc/resolver/archive.today
cat 'nameserver 8.8.8.8' > /etc/resolver/archive.is
cat 'nameserver 8.8.8.8' > /etc/resolver/archive.md
cat 'nameserver 8.8.8.8' > /etc/resolver/archive.ph
etc for all their various mirrors. Check manpages I guess for any differences but something close to that. Though note that irritatingly not all applications will necessarily pay attention to the OS resolver (by default, or at all) in the first place. If not and you can't switch you'll have to dig into prefs/workarounds for those specific ones.
----
As a meta-note to all this, this is the kind of manual change that is easy to set and then have just sit there for a decade and completely forget about, then have it potentially cause some head scratching if/when something changes on the far side. Always a good habit to keep an orderly record of such things, or have it as some sort of playbook for auto-setting up systems so you can comment it with the date and reason.