After years of struggling I managed to get ownership of the only TLD I care of. .dev as in developer is now mine… all mine! Seek evidence below:

Ok… Let's get serious again…
But… I'll teach you how to get any domain/subdomain working on your Windows computer in less then 5 minutes. And this will be of enormous help for your developement environment.
I've had a no-ip.com paid subscription for two years now and it has been the best investment I have ever made online. 10$/yr allow me to own any subdomain with them and each subdomain can have an unlimited number of subdomains by just checking a simple checkbox. Check this screenshot!
Btw… they don't offer an affiliate programme so this review is sincere. It helped me a lot with customers (back in the days when I worked for others) and I could show them my work at anytime from my own computer with this dynamic DNS service.
In 90% of situations, unless someone else has to see your work, you can host your own dynamic DNS service and have any domain/subdomain work. And this is all thanks to Microsoft, the company that thinks about the people.
Hosts file is a file with no extension located at one of the following addresses depending on your Operating System:
The hosts file is a very simple text file that has one entry per line. If the line starts with # it is considered a comment otherwise it needs to have the following format:
127.0.0.1[space]localhost[space]#optional comment
Actually the entry above exists in hosts and defines the localhost we all use.
As a developer you need to be fast. And many times you need to add hosts/subdomain quickly. As I said the hosts file has no extension so editing it is quite cumbersome. Right Click - Open With - Notepad! This is not the cool and smart way. Just follow the easy steps below for the smart way:
- Copy (Ctrl+C) the path of hosts that matches your OS from above (usually: %windir%\system32\drivers\etc\hosts)
- Start - Run - %windir% [hit enter]
- Right Click Menu - New - Shortcut
- Type in address field: notepad Paste (Ctrl+V) here path of hosts file [hit Enter]
- Type hosts in the field [hit Enter]
If you could not follow the steps above please close this page. If you could you will have in your windows directory and new shortcut named hosts! Not go to Start (Ctrl+Esc) - Run - hosts [hit Enter]. This is the easy way to edit the hosts file.
Let's say your site needs the following domains to work: domain.com, www.domain.com, admin.domain.com. And they need to load from the local host (local developement environment). Then you hosts file need to look like this:
127.0.0.1 domain.com
127.0.0.1 www.domain.com
127.0.0.1 admin.domain.com
It can't be easier then this. If you need a site to load from a different IP just change 127.0.0.1 to another, let's 192.168.0.5 - a network computer where the webserver runs. Warning: by setting 0.0.0.0 as IP that host will be locked. So if you want to block access to a certain hostname (block some ads) just add it with 0.0.0.0 in front.
Hosts does not accept wildcards. You can not set 127.0.0.1 *.dev to take control over an entire TLD. You need to set each project, each domain/subdomain in the file. No IP offers * CNAME but not everybody needs it.
Other issues you might have may be the following but, keep in mind, I do not consider them issues.
So, by using hosts instead of no-ip.com or other such services, you protect your and your developement environment's privacy. But you will need to add each subdomain by hand as * wildcards don't work.
First of all make sure the Apache httpd.conf has the following two lines (use Ctrl+F to find them) uncommented (no # found in front):
In conf folder in Apache you will find the extra folder with contains the vhosts file. Open it with notepad and add the following to get the domain.com to work along with any subdomain also. Replace \ with / in the-full-path-of-your-site as Apache knows this version better.
<VirtualHost *:80>
The bold line in the code makes any subdomain work and you just handle them with .htaccess!
DocumentRoot "the-full-path-of-your-site"
ServerName domain.com
ServerAlias *.domain.com
</VirtualHost>
I think it's all explicit enough. I assume you already use Apache and PHP or something else to develop and you know how to add new hosts. So the only trick is the hosts file which will replace your current DNS.
If you used to develop sites with localhost/site/… change now and get the feel of domain/subdomain based developement. This will also help you get used to SEO, learn how to redirect non-www to www version of site and so on. You will know exactly how your site will behave online running on a domain root address.
If there's stuff you did not understand well hit me back in the form below. And I'll do my best. I might have been a bit supperficial as it's all too easy for me but it's one of the longest tutorials I wrote.
PS: If you like it… link it;)