Advertisement
codegazer

2017_07_12_dns_localhost_resolution_2

Jul 12th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $ cat /etc/hosts
  2. 127.0.0.1 localhost
  3. ::1 localhost
  4.  
  5. $ host 127.0.0.1
  6. 1.0.0.127.in-addr.arpa domain name pointer localhost.
  7.  
  8. $ host localhost.
  9. Host localhost. not found: 3(NXDOMAIN)
  10.  
  11. $ grep "^hosts:" /etc/nsswitch.conf
  12. hosts: files nis dns myhostname
  13.  
  14. # Adding "localhost 127.0.0.1" to /etc/hosts:
  15.  
  16. $ nl /etc/hosts
  17. 1 127.0.0.1 localhost
  18. 2 ::1 localhost
  19. 3 localhost 127.0.0.1
  20.  
  21. $ host 127.0.0.1
  22. 1.0.0.127.in-addr.arpa domain name pointer localhost.
  23.  
  24. $ host localhost
  25. Host localhost not found: 3(NXDOMAIN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement