DNS over Tor example script overwrites /etc/hosts

Thanks Cloudflare for the amazing hidden DNS resolver!

I was trying the instructions at DNS over Tor · Cloudflare 1.1.1.1 docs and executed step 3:

cat << EOF > /etc/hosts
127.0.0.1 dns4torpnlfs2ifuz2s2yf3fc7rdmsbhm6rw75euj35pac6ap25zgqad.onion
EOF

I was expecting this command to append to /etc/hosts instead of overwriting it. My feedback is to change the example script to cat << EOF >> /etc/hosts. This could prevent others from accidentally losing their hosts file (as I did).

2 Likes

@cloonan

This topic was automatically closed after 14 days. New replies are no longer allowed.