ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

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

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2023
  • 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 www.facebook.com
    4. In the above example www.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: • Ubuntu Linux Tutorials
    Bash Shell Scripting Tutorial: • Bash Shell Scripting T...
    Install Android Studio on Ubuntu 22.04 LTS | Android Studio on Ubuntu 22.04 LTS: • How to Install Android...
    Install Ubuntu on Windows 11 (WSL) | Windows Subsystem for Linux with GUI Support: • How to Install Ubuntu ...
    Reset Forgotten Ubuntu Linux Password on WSL | Debian, Kali, Linux Password Reset on WSL | Windows 11: • Reset Forgotten Ubuntu...
    Install Vim (Vi Improved) Text Editor on Ubuntu | Debian Linux: • How to Install Vim (Vi...
    Ubuntu 23.04 - Is it WORTH Making the Upgrade? Let's learn how to upgrade!: • Ubuntu 23.04 - Is it W...
    Upgrade Ubuntu to Ubuntu 23.04 Lunar Lobster using Graphical User Interface | Using GUI: • How to Upgrade Ubuntu ...
    Edit Hosts file in Ubuntu | How to Block Websites in Linux using /etc/hosts file: • How to edit Hosts file...
    --------
    More Tutorials for VMWare Workstation Player:
    • VMware Workstation Tut...
    Install Microsoft Windows 11 on VMware Player: • How to Install Microso...
    Make Windows 11 Full Screen in VMware Workstation Player: • How to Make Windows 11...
    Install macOS 12 Monterey on VMware Player: • How to Install macOS 1...
    Install VMware Tools and Make macOS 12 Monterey Full Screen: • Full Screen HD Display...
    Fix No Internet Connection in macOS 12 Monterey on VMware Player: • Fix No Internet Connec...
    Install macOS 13 Ventura on VMware Player: • How to Install macOS 1...
    Install VMware Tools and Make macOS 13 Ventura Full Screen: • How to Make macOS 13 V...
    Fix No Internet Connection in macOS 13 Ventura in VMware Player: • Fix No Internet Connec...
    Install Ubuntu 22.04 LTS on VMware Player: • How to Install Ubuntu ...
    Create Manual Snapshot in VMware Player: • How to Create Manual S...
    Install Ubuntu 23.04 on VMware Workstation Player On Windows 11: • What is Virtual Machin...
    VMware Workstation/Pro very Slow on Windows 11 22H2 - VMware Technology Network VMTN
    • VMware Workstation/Pro...
    --------
    More Tutorials on macOS:
    • macOS Tutorials
    Download and Install NodeJS, HomeBrew (Package Manager) and N (Version Manager) on macOS: • How to Install NodeJS ...
    Install Oracle Java JDK and OpenJDK on macOS 13 Ventura: • How to Install Java JD...
    --------
    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

ความคิดเห็น • 1