Spoofing DNS

From Public wiki of Kevin P. Inscoe
Jump to navigation Jump to search

If you don't have root (I do but didn't want to change /etc/resolv.conf for this) and you want to override DNS choices (spoof testing or such) I present you:

$ echo "foo www.google.com" >> ~/.hosts
$ HOSTALIASES=~/.hosts
$ curl foo

man hostname(7)