How to edit Hosts file in Windows 11 | Edit hosts file | Block a Domain or a Sub-Domain

Поделиться
HTML-код
  • Опубликовано: 8 июн 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 Windows hosts file:
    1. Once you have your Windows 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 windows 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] Windows hosts file location:
    C:\Windows\System32\drivers\etc\hosts
    --------
    hosts file default contents:
    Copyright (c) 1993-2009 Microsoft Corp.
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    # This file contains the mappings of IP addresses to host names. Each
    entry should be kept on an individual line. The IP address should
    be placed in the first column followed by the corresponding host name.
    The IP address and the host name should be separated by at least one
    space.
    # Additionally, comments (such as these) may be inserted on individual
    lines or following the machine name denoted by a '#' symbol.
    # For example:
    #
    #102.54.94.97 rhino.acme.com # source server
    #38.25.63.10 x.acme.com # x client host
    localhost name resolution is handled within DNS itself.
    127.0.0.1 localhost
    ::1 localhost
    --------
    VirtualBox playlist: • VirtualBox Tutorial
    Install Windows XP on Oracle VirtualBox: • How to Install Windows...
    Set Widescreen 16:9 Resolutions in Windows XP running on VirtualBox: • How to Set Widescreen ...
    Enable Shared Clipboard and Drag and Drop in Windows XP running on VirtualBox: • How to Enable Shared C...
    Solve The “16-bit MS-DOS Subsystem” Installation Error in Windows XP running on VirtualBox: • How To Solve The “16-b...
    Install Ubuntu 22.04 LTS in VirtualBox running on Windows 11: • How to Install Ubuntu ...
    Install macOS Monterey in VirtualBox running on Windows 11: • How to Install Apple m...
    Make Ubuntu Full Screen in VirtualBox on Windows 11 | Fix Screen Scaling in Ubuntu 22.04: • How to Make Ubuntu Ful...
    Install VirtualBox Guest Additions on Ubuntu 22.04 Guest/Virtual Machine: • How to Install Virtual...
    Install Oracle Java (JDK) On Ubuntu 22.04 LTS: • How To Install Oracle ...
    Install Node.js on Ubuntu 22.04 LTS | Install NodeJS and npm | For React, Web Development: • How To Install Node.js...
    Install and Use Visual Studio Code on Ubuntu 22.04 LTS Linux (VS Code): • How to Install and Use...
    Install Microsoft Windows 11 on VirtualBox: • How to Install Microso...
    Make Windows 11 Full Screen in VirtualBox | Fix Screen Scaling | Guest Additions Pack: • How to Make Windows 11...
    Install VirtualBox on Windows 11: • How to Install Virtual...
    Install Ubuntu 22.10 on VirtualBox in Windows 11: • How to Install Ubuntu ...
    Make Ubuntu Full Screen in VirtualBox | Fix Screen Scaling in Ubuntu 22.10 / Ubuntu 22.04 LTS: • How to Make Ubuntu Ful...
    Install Linux Mint 21 Cinnamon on VirtualBox | Compute Hash using SHA256 and Verify ISO: • Install Linux Mint 21 ...
    Make Linux Mint Full Screen in VirtualBox | Fix Screen Scaling in Linux Mint 21: • How to Make Linux Mint...
    Install Ubuntu 23.04 on VirtualBox in Windows 11 | Ubuntu Lunar Lobster: • How to Install Ubuntu ...
    Make Ubuntu Full Screen in VirtualBox: • How to Make Ubuntu Ful...
    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
    #windows11 #tanztalkstech2 #tanzTalkstech #tanzeelosama ‪@tanzTalks.tech2‬ ‪@tanzTalkstech‬ ‪@TanzeelOAnsari‬
  • НаукаНаука

Комментарии • 10

  • @sonikayenamandra
    @sonikayenamandra 8 месяцев назад

    My host file was corrupted it was easy to follow and edit . Thank you was really helpfull.

  • @akshayr1646
    @akshayr1646 6 месяцев назад

    Thanks

  • @user-ev2ym7yd6h
    @user-ev2ym7yd6h 7 месяцев назад

    thanks

  • @athulkrishnantk5715
    @athulkrishnantk5715 9 дней назад

    But still its connecting to one web page to which i have added. What to do in this case

    • @tanzTalkstech
      @tanzTalkstech  9 дней назад

      The webpage must be having many different sub domains. You’ll have to add all of them to the list.

  • @monikasahu2193
    @monikasahu2193 2 месяца назад

    Still not connected

    • @tanzTalkstech
      @tanzTalkstech  2 месяца назад

      Connected? Video is about editing Hosts File and not making connections.

  • @joelchamp1949
    @joelchamp1949 Месяц назад

    Thanks