Site Overlay

Adding Entries to Windows 11 Hosts File Using CMD

💻 Adding Entries to Windows 11 Hosts File Using CMD

You can add IP and FQDN mappings to the hosts file in Windows 11 using CMD. This method allows you to edit the hosts file quickly without opening Notepad and ensures efficient management.

📌 1. Open CMD as Administrator

To write to the hosts file, you need an elevated CMD. Search for CMD in the Start menu → right-click → select Run as administrator.

📌 2. Append Entry to Hosts File

Use the following command to add a new IP and hostname to the hosts file:

echo 10.168.90.190 arifakyuz.com >> C:\Windows\System32\drivers\etc\hosts
            

This command appends the line to the end of the file without overwriting existing content.

📌 3. Verify the Entry

To check if the new entry appears correctly:

type C:\Windows\System32\drivers\etc\hosts
            

This displays the entire hosts file content in CMD.

📌 4. Notes and Alternative Methods

  • Spaces or tabs between the IP and FQDN are acceptable; Windows parses them correctly.
  • If you encounter permission issues with the standard >> operator, try:
    cmd /c "echo 10.168.90.190 arifakyuz.com >> C:\Windows\System32\drivers\etc\hosts"
                        
  • You can also use PowerShell to add entries to the hosts file if preferred.

✅ Summary Table

Step Description Example Command
1 Open CMD as Administrator
2 Append IP-FQDN to hosts file echo 10.168.90.190 arifakyuz.com >> C:\Windows\System32\drivers\etc\hosts
3 Verify the entry type C:\Windows\System32\drivers\etc\hosts

📝 Conclusion

Adding entries to the hosts file using CMD is fast and secure. By using an elevated CMD, you can append IP-FQDN mappings without Notepad and manage network settings efficiently on Windows 11.

arif akyuz
Arif Akyüz

image
Başka cihazda görüntüle
Arif Akyüz Sistem Network Yöneticisi ve Siber Güvenlik Uzmanı
Arif Akyüz Sistem Network Yöneticisi ve Siber Güvenlik Uzmanı

Arif Akyüz
Bilgi Teknolojileri
Sistem Network Yöneticisi
ve Siber Güvenlik Uzmanı
[email protected]

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors