How to edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file @tanzTalkstech
How to edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file  @tanzTalkstech
Uploaded June 2023 | Updated September 2026, 2 weeks ago
Liked my video? 👍Buy me a cup of coffee! 🍵
youtube.com/channel/UCMz232hZ7fD75uGWhuLNjtA/join

Hosts file is used to resolve domain names without using Domain Name System (DNS).

This means that whenever your computer tries to connect to the domain (say) 'www.facebook.com' it will not request DNS for its IP address and instead consider 0.0.0.0 to be the IP address of 'www.facebook.com'

127.0.0.1 is a special address, called loopback IP address and If any public switch, router, or gateway receives a packet addressed to the loopback IP address, it is required to drop the packet without logging the information.

So, we have made domain 'www.facebook.com' unreachable in our example.

Click on like button if you liked the video.


Steps to block domains & subdomains using hosts file:
1. Once you have your hosts file open, enter a comment in your hosts file to organize your mappings of IP addresses to host names
2. To add a comment, make sure you're on a new line and type "#" followed by your comment details. The "#" symbol will tell your computer to ignore anything that comes after "#" on the same line
3. Next, again on a separate line, enter 0.0.0.0 and a space followed by your domain name or subdomain name (website address) to be blocked.

For example:
#Block Facebook
0.0.0.0 facebook.com

4. In the above example facebook.com (domain name) will be blocked by the hosts file. To save these entries, navigate to the top left hand corner to file, left click on it and left click on save.

5. Open up your browser and navigate to the website URL address you have just added to your hosts file. The blocked website will now be unreachable meaning that it has been blocked successfully.
‪
‪[Note] Ubuntu hosts file location:
\etc\hosts

--------

Ubuntu Tutorials: youtube.com/playlist?list=PLnisUReSm0-nc0N5IlO0QoJd78oBhlHoX

Bash Shell Scripting Tutorial: youtube.com/playlist?list=PLnisUReSm0-n4vwT7Dzjhw5Vjz32clx6N

Install Android Studio on Ubuntu 22.04 LTS | Android Studio on Ubuntu 22.04 LTS: youtu.be/hEdpm1PfvvM
Install Ubuntu on Windows 11 (WSL) | Windows Subsystem for Linux with GUI Support: youtu.be/NXJjutYp4x8
Reset Forgotten Ubuntu Linux Password on WSL | Debian, Kali, Linux Password Reset on WSL | Windows 11: youtu.be/oeXuxqR60Ns
Install Vim (Vi Improved) Text Editor on Ubuntu | Debian Linux: youtu.be/zr17y9YHopQ
Ubuntu 23.04 - Is it WORTH Making the Upgrade? Let's learn how to upgrade!: youtu.be/dj38ni4dOpA
Upgrade Ubuntu to Ubuntu 23.04 Lunar Lobster using Graphical User Interface | Using GUI: youtu.be/Q0xF4wrfA90
Edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file: youtu.be/z6RxqJzLaQY

--------

More Tutorials for VMWare Workstation Player:
youtube.com/playlist?list=PLnisUReSm0-ncHac3_ZAsE5g7nWy88Qta

Install Microsoft Windows 11 on VMware Player: youtu.be/3HBSuoVOpt0
Make Windows 11 Full Screen in VMware Workstation Player: youtu.be/1XaPXGYMwTo

Install macOS 12 Monterey on VMware Player: youtu.be/WLMTAqZ_3xU
Install VMware Tools and Make macOS 12 Monterey Full Screen: youtu.be/pF4mwgiYIaY
Fix No Internet Connection in macOS 12 Monterey on VMware Player: youtu.be/S7yRdl-kAAg

Install macOS 13 Ventura on VMware Player: youtu.be/CeSqdrf1WOg
Install VMware Tools and Make macOS 13 Ventura Full Screen: youtu.be/WQdGIRFL8qw
Fix No Internet Connection in macOS 13 Ventura in VMware Player: youtu.be/i-DDDDiAmPw

Install Ubuntu 22.04 LTS on VMware Player: youtu.be/LvYaZMV-ZlY
Create Manual Snapshot in VMware Player: youtu.be/QOTJbtyu0XQ

Install Ubuntu 23.04 on VMware Workstation Player On Windows 11: youtu.be/St4UOkJVlMU

VMware Workstation/Pro very Slow on Windows 11 22H2 - VMware Technology Network VMTN
youtu.be/2cG7Cew_41A

--------

More Tutorials on macOS: youtube.com/playlist?list=PLnisUReSm0-kC89Ml7Wm5kPdXvgbqndUp

Download and Install NodeJS, HomeBrew (Package Manager) and N (Version Manager) on macOS: youtu.be/O6MKC5TgQao

Install Oracle Java JDK and OpenJDK on macOS 13 Ventura: youtu.be/F5HTPakOdi4

--------

My Gear:
MSI GL65 Leopard Gaming Laptop
Intel Core i7-10750H 2.6GHz, 10th Gen (6 Cores)
15.6" FHD (1920*1080), IPS-Level 144Hz
16GB DDR4 RAM, 2666Mhz
Nvidia GeForce RTX 2060, 6GB ‎GDDR6
256GB NVMe M.2 SSD + 1TB SATA 7200RPM HDD
Windows 11 Home, 64Bit
HD Webcam (720p at 30 fps)
Per Key RGB SteelSeries Keypad

#Ubuntu #Linux #tanztalkstech2 #tanzTalkstech #tanzeelosama @tanzTalks.tech2 @tanzTalkstech @TanzeelOAnsari
How to edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file
tanzTalks.tech |

How to edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER