• Skip to main content
  • Skip to primary sidebar
Making Different

Making Different

Create, Learn, Build or Fix

  • Tech
  • Business
  • Relationship
  • Health
  • Travel
You are here: Home / Windows / How to Block a Website Using Windows Command Prompt

How to Block a Website Using Windows Command Prompt

April 2, 2023 by Nitin Maheta

Are you a parent concerned about your children spending too much time on their favorite websites? Or, are you an employer looking to limit your employees’ access to certain websites during working hours? Fortunately, Microsoft Windows Command Prompt utility can come in handy to block access to specific websites. In this article, we will guide you through the process of blocking access to a website using Command Prompt.

Contents

  • Step 1:
  • Step 2:
  • Step 3:
  • Step 4:
  • Step 5:
  • Step 6:
  • Step 7:
  • Conclusion

Step 1:

Shut down all applications and programs on your computer. This step is crucial to ensure that the changes you make are not overwritten by any open applications or programs.

Step 2:

Press the “Windows-R” keys at the same time. This will open the Run dialog box.

Step 3:

Type “cmd” in the field and select the “OK” button. This will open the Command Prompt window.

Step 4:

Type “notepad C:/Windows/System32/drivers/etc/hosts” in the command window. This will open the Hosts file in Notepad.

Step 5:

Find the line that contains “127.0.0.1 local host.” This line indicates the localhost IP address.

Step 6:

Type “127.0.0.1 URL” on the next line, with “URL” being the site you want to block. For example, if you want to block CNN, type “127.0.0.1 cnn.com.” This will redirect the website to the local host and prevent it from loading.

Step 7:

Save the file. Exit all windows. After saving the changes, exit the Command Prompt and Notepad windows. You can now try accessing the website you just blocked, and you will notice that it won’t load.

Similar posts:
When to Introduce Your Child to a Smartphone or Tablet?
How to Block YouTube on Chrome
How to Turn On or Turn Off YouTube Safety Mode
How To Block A Number On Your iPhone

Conclusion

Microsoft Windows Command Prompt utility provides an easy and effective way to block access to specific websites. By following the steps outlined above, you can restrict access to certain websites and ensure that your children or employees are not wasting time on them during working hours. Always remember to save the changes and exit all windows after making the necessary adjustments to the Hosts file.



About Nitin Maheta

Nitin Maheta is editor in chief and webmaster of MakingDifferent Blog. You may reach him out on following social media:

Facebook | Twitter | Instagram

Primary Sidebar

Similar Posts

  • How to Block Websites With a Password
  • How to Locate My Graphics Card Control Panel
  • How to Stop Computer From Logging Off
  • When to Introduce Your Child to a Smartphone or Tablet?
  • 20 Amazing Rainmeter Skins
  • How to Control Your Kid’s Smartphone Addiction
  • 10 Steps to Teaching Your Child How to Read
  • 10 Things to Consider When Hiring a Babysitter
  • What is a Baby Shower?
  • Good Things about Having a Baby Girl
  • Baby Birth Announcement Wordings
  • WhatsApp Status for Newborn Baby Girl
  • WhatsApp Status for Newborn Baby Boy
  • Child Adoption Laws in India
  • New Born Baby Status, Captions and Messages

Random Posts

spying

How to Spy on your NonTechie Lover

By Nitin Maheta

make-a-window-stay-always-on-top

How to Keep a Window Always On Top of Windows 10

By Nitin Maheta

Mystery-Box-by-asus

“Mystery Box” by ASUS India to Bloggers and Journalists

By Nitin Maheta

NSFW-logo

What Does “NSFW” Mean, and How to Use it

By Nitin Maheta

1st-bithday

The Best Party Ideas for Baby’s 1st Birthday

By Nitin Maheta

All categories | About us | Contact us | Privacy policy | Disclaimer | Write for Us | Dictionary | Sitemap

The owner of this site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.

© 2025 Making Different