3 ms·
I do this, too. It's called HOSTS and djb's cdb constant database. And one does not need to use a recursive cache to get the IP addresses. Fetching them non-
by gwu78 10y ago
I do this, too.
It's called HOSTS and djb's cdb constant database.
And one does not need to use a recursive cache to get the IP addresses. Fetching them non-recursively and dumping them to a HOSTS and a cdb file can sometimes be faster; I have a script that does that. Fetching them from scans.io can be even faster.
cd||exit
[ -c null ]||mknod null c 2 2
case $# in
0)
{
sed '
/#/d;
/^[0-9]/!d;
' /etc/hosts \
|{
while read a b c d;
do
echo +${#b},${#a}:$b-\>$a;
done;
}
echo;
} \
|exec awk '!($0 in a){a[$0];print}' \
|exec cdbmake $0.cdb $0.t||exit
exec cdbdump < $0.cdb
;;1)
test ${#0} = 2 ||
exec cdbget $1 < $0.cdb >null;
exec cdbget $1 < $0.cdb;
esac
usage: $0
usage: $0 domainname
First usage compiles and dumps database to screen.
Second usage checks for presence of domainname and exits 0 if present otherwise exits 100.
Third usage is if $0 is only two characters it will check for presence of domainname and if present print the IP and domainname in HOSTS format.
http://cr.yp.to/cdb.html http://cr.yp.to/cdb.html
With all due respect to the enormous reliance on it that has built up over the past decades, DNS is not the internet. It is just a service heavily used for things like email and web. This does not mean, in an emergency, email and web cannot work without DNS. They once did and they still can.
The internet runs just fine without DNS. Some software may refuse to honour HOSTS and rely on solely on DNS. But that is a vulnerability of the software, not the internet. (And in such cases, e.g., qmail, I just serve my own zone via tinydns, which again is just a mirror of HOSTS.)
- nialv7 10y agoWhat you are doing and claiming is ridiculous. For one, how are you doing to deal with stale records?
- deleted 10y ago[deleted]