I am trying to block access to youtube by adding the static record to hosts file.
But i still have youtube access. It seems like the hosts file have been ignored.
Code: Select all
$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
0.0.0.0 youtube.com
Code: Select all
$ ping -c1 youtube.com
PING youtube.com (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.035 ms
Code: Select all
$ dig youtube.com
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el8 <<>> youtube.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36706
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;youtube.com. IN A
;; ANSWER SECTION:
youtube.com. 257 IN A 216.58.207.46
;; Query time: 77 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Mar 03 21:19:30 IST 2020
;; MSG SIZE rcvd: 56