Hosts files are great, you can specify any host to IP combination, overriding anything.
But what about other types of records? Hosts files can’t do service, text, pointer records, etc? So what to do if you want to test these record types? You could setup your own DNS server, create a new zone, add the records to test, while mail, chat, and other services fail left and right on your machine. Or you could use SnojNS.
SnojNS sits between you and your current DNS server. It can add or change domains much like the hosts file, but it can do so much more, like CNAME, PTR, or SRV record types. I’m hoping to add more at later dates, but not to worry, when it comes across a request it doesn’t understand, it just forwards it and relays the info back so you’re never without internet access.
Unzip it or compile, edit the hosts.config, open a command prompt, and run. Or if you’re feeling brave, double click to run it and forget about logging any errors that pop up.
Seems to have an issue when there is a lot of requests. That is…it’ll crash. Though the data suggests that it has to do with the forward lookup rejecting udp connections and we can’t yet recover from the error.
If you’re smart enough to run this, you’ll know which you’ll want to get.
snojns 0.1.0: Release, Debug, Source
- define a, cname, ptr, and srv resource records
- forward lookups for undefined domains and unknown resource record types
- define forward lookups based on requested domain
- somehost.com can use google’s servers (18.104.22.168) while someotherhost.com uses opendns’ (22.214.171.124)
- a lot of unused code and commented out sections.
Features Road map:
Not all may happen, but ideas I’d like to explore.
- config file watch: try reloading the hosts file after a save operation so there’s no need to restart.
- more record types: like AAAA (ipv6), TXT, and MX.
- separate dns packet parsing into its own dll
- create an actual windows service?
- cache! need that cache.
- ttl definitions for local records?
- plugin system to introduce new record types and classes (though who would use anything other than IN?)
- lookups over ssh: ‘cuz we can’t trust the transit (I’m looking at you Hak5, with your pineapple).
- load balancing round robins for both answers and forward lookups.
Also, if someone comes up with a better name than “SnojNS” that I like, I’ll buy you $10-15 something from woot.com or amazon as thanks….so thanks! Just post it in the comments or something, as long as I get your email and address.