Windows hosts.txt

Relax and enjoy The Lounge. For all Non-Joomla! topics or ones that don't fit anywhere else. Normal forum rules apply.
Post Reply
User avatar
trogladyte
Joomla! Explorer
Joomla! Explorer
Posts: 442
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Windows hosts.txt

Post by trogladyte » Tue Oct 19, 2021 1:37 am

In the past, when installing a new site of which there is one currently live, I've used hosts.cx to get a unique URL. However, it's dead right now and I need to install a new site.

In the past I've had issues getting Win 10 to recognize hosts.txt changes. But I decided to have another go.... still having issues. I read a ton of stuff on stackoverflow and other places and tried almost everything written to fix it. It's definitely something on my computer because (and this is what I'll have to do for this install) I can hop on my wife's computer (also Win 10), edit the hosts.txt, and install without issue. We're both on the same network so it's definitely inside the office and definitely just me.

Anyone have any bright ideas?
Last edited by imanickam on Tue Oct 19, 2021 4:03 pm, edited 1 time in total.
Reason: Moved topic » from Administration Joomla! 4.x to The Lounge
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Certified Flight Instructor http://www.flygoodyear.com

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11206
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Windows hosts file (is not a .txt file)

Post by sozzled » Tue Oct 19, 2021 2:00 am

See https://www.groovypost.com/howto/edit-h ... indows-10/

I don't know how this relates to J!, though.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13806
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Windows hosts.txt

Post by toivo » Tue Oct 19, 2021 2:26 am

trogladyte wrote:
Tue Oct 19, 2021 1:37 am
In the past I've had issues getting Win 10 to recognize hosts.txt changes.
The name of the file is just hosts, not hosts.txt.

Notepad++ in Administrator mode processes updates to the hosts file all right.
Toivo Talikka, Global Moderator

User avatar
trogladyte
Joomla! Explorer
Joomla! Explorer
Posts: 442
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Re: Windows hosts.txt

Post by trogladyte » Tue Oct 19, 2021 2:27 am

No it's not specfically related to Joomla. But, I'd done a pretty exhaustive search elsewhere; was looking for some experience from the Joomla forum. Thanks for the article - nice little editor, but, alas, it didn't help.
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Certified Flight Instructor http://www.flygoodyear.com

User avatar
trogladyte
Joomla! Explorer
Joomla! Explorer
Posts: 442
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Re: Windows hosts.txt

Post by trogladyte » Tue Oct 19, 2021 2:31 am

Looking in the drivers\etc directory, I see it is saved as just plain "hosts" without the .txt. Funny, everyone on the web calls it hosts.txt.
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Certified Flight Instructor http://www.flygoodyear.com

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13806
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Windows hosts.txt

Post by toivo » Tue Oct 19, 2021 2:38 am

So you use the hosts file to generate a dummy domain to refer to an external website still in development?

It is also possible to get the hosts file to point dummy domains to the local IP address 127.0.0.1 in the Windows workstation, when test sites are hosted locally, running a bundle like Wampserver.

Which editor do you use?

As you noticed, you need to make sure that the editor does not add the extension .txt to the filename.
Toivo Talikka, Global Moderator

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 11206
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Windows hosts file

Post by sozzled » Tue Oct 19, 2021 2:43 am

I have the Windows host file many times. I have my reasons for doing this; they are not specifically related to J!.

Why, specifically, do you need to edit this file? Is there a problem with accessing certain websites on the internet?

In my situation, I need to maintain the Windows hosts files with several different computers within my LAN IP subnet range.

As far as editing is concerned, I use Windows Notepad (as long as you "Run as administrator" as mentioned in the link I posted earlier).
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

User avatar
trogladyte
Joomla! Explorer
Joomla! Explorer
Posts: 442
Joined: Sat May 03, 2008 9:27 pm
Location: Phoenix, AZ
Contact:

Re: Windows hosts.txt

Post by trogladyte » Tue Oct 19, 2021 12:35 pm

When I'm uploading a new version of a site which exists on the net already (for example, I've rebuilt www.wwcspro.com). I need to upload that site onto my hosting, then I change change, in this case, the A record which will ensure a smooth transition from the old, existing site, to the new one.

Changing the hosts file and adding:

<my hosting IP> wwcspro.com

I can install it using wwcspro.com/kickstart.php (I'm using Akeeba Backup). However, if there's an easier/different way to accomplish this, I'm all ears!
Ian Shere - Phoenix Website Design & Hosting
http://www.citruskiwi.com
Certified Flight Instructor http://www.flygoodyear.com


Post Reply

Return to “The Lounge”