Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I have added a site in my hosts file but its not working, please view the pics.

My Hosts file

 127.0.0.1       localhost
 127.0.1.1       Ubuntu.local    Ubuntu
 127.0.0.1       dailymotion.com *.dailymotion.com http://www.dailymotion.com*
 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters

As added in hosts file the site is blocked enter image description here

Copy Paste The Video Link ....Site is not Block enter image description here

How do i block each and every link that has http://dailymotion.com/

I have tried with 0.0.0.0 dailymotion.com to hosts file, nothing work..But in Windows 7 & Windows 8 its working perfectly

Not interested in weird iptables commands

Thanks

Thanks to Achu

enter image description here

share|improve this question

marked as duplicate by Thomas W., Eric Carvalho, green7, Raja, belacq Apr 27 '13 at 3:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You have to look where the video is coming from. My guess would by youtube. You probably want to use a web proxy such as privoxy or squid, but configuration can be a bit complicated. Hard to know without knowing where the video is from (Go under Tools -> Web Developer -> Page source and see if you can determine where the video is coming from). Also know that you can call content by server_name.com or ip address. If the content is called by ip address your hosts file will not work. –  bodhi.zazen Apr 25 '13 at 18:58
    
1st of the duplicate question is very old and i want to block it , @bodhi.zazen ok let me check and update ...thanks all –  Qasim Apr 25 '13 at 19:06
    
why the same stuff is working in windows 7 and in windows 8 ??? hosts file –  Qasim Apr 25 '13 at 19:06
1  
@XxxXxx please try this way 127.0.0.1 www.dailymotion.com 127.0.0.1 dailymotion.com 127.0.0.1 *.dmcdn.net 127.0.0.1 dmcdn.net put them on each line. i saw videos come from dmcd.net –  Achu Apr 25 '13 at 19:16
1  
@Achu thanks a lot man ......blocked –  Qasim Apr 25 '13 at 19:20

1 Answer 1

up vote 4 down vote accepted

Please put this way

127.0.0.1 www.dailymotion.com 
127.0.0.1 dailymotion.com 
127.0.0.1 *.dmcdn.net 
127.0.0.1 dmcdn.net 

I can see that dailymotion video's comes from dmcd.net

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.