Stop Waiting For DNS!
I am an impulse domain buyer. I tend to purchase silly names for simple sites that only serve the purpose of an inside joke. The thing about impulse-buying a domain is that DNS propagation generally takes a day or so, and setting up a Web site with a virtual hostname can be delayed while you wait for your Web site address to go "live".
Thankfully, there's a simple solution: the /etc/hosts file. By manually entering the DNS information, you'll get instant access to your new domain. That doesn't mean it will work for the rest of the Internet before DNS propagation, but it means you can set up and test your Web site immediately. Just remember to delete the entry in /etc/hosts after DNS propagates, or you might end up with a stale entry when your novelty Web site goes viral and you have to change your Web host!
The format for /etc/hosts is self-explanatory, but you can add comments by preceding with a # character if desired.
Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- Trying to Tame the Tablet
- Paranoid Penguin - Building a Secure Squid Web Proxy, Part IV
- Developer Poll
- Looking Good
1 hour 56 min ago - Hey God - You may not be
6 hours 10 min ago - Reply to comment | Linux Journal
8 hours 43 min ago - Drupal is an Awesome CMS and a Crappy development framework
13 hours 22 min ago - IT industry leaders
15 hours 44 min ago - Reply to comment | Linux Journal
1 day 8 hours ago - Reply to comment | Linux Journal
1 day 11 hours ago - Reply to comment | Linux Journal
1 day 12 hours ago - great post
1 day 12 hours ago - Google Docs
1 day 13 hours ago



Comments
Domain buyer
I'm also addicted to domain names, thank you for this trick to speed up the launch of my future websites.
really
Trick very useful, thank you but I find that the propagation time is really becoming shorter, right?
really
Trick very useful, thank you but I find that the propagation time is really becoming shorter, right?
/etc/hosts + DNSmasq
If you have a small network and an always-on server, you can easily set up your own DNS server with dnsmasq (http://www.thekelleys.org.uk/dnsmasq/doc.html, or try "apt-get dnsmasq" if you have a Debian-based distro). I got tired of managing a hosts file on each of my home machines. Now I just point my DNS to a local address. And you don't need to wait for changes to propagate - just reload or restart the dnsmasq service.
And "blackhole" sites you don't want to access
Most of my machines with Internet access get at least one entry added to /etc/hosts to block ad.doubleclick.net thus:
127.0.0.1 ad.doubleclick.net
Add any other sites you want ignored with the localhost IP, 127.0.0.1
Of course there are a number of sources on the net from which to download pre-determineds lists with 100's if not 1000's of such blackhole'ed sites for your surfing peace - BinGle for them.
Automate it, even
Here's a shell script I wrote that aggregates a few of the more popular blackhole sites into a single HOSTS file. I also change 127.0.0.1 to 0.0.0.0 because this bypasses the wait for the resolver to fail.
http://www.kubuntuforums.net/showthread.php?56419-Script-to-automate-bui...
And of course, one can use it
And of course, one can use it to access the pirate bay in Belgium, by adding:
178.73.210.219 thepiratebay.se
178.73.210.219 www.thepiratebay.se
178.73.210.219 thepiratebay.org
178.73.210.219 www.thepiratebay.org
178.73.210.219 piratebay.se
178.73.210.219 www.piratebay.se
178.73.210.219 piratebay.org
178.73.210.219 www.piratebay.org
You can use one line various aliases
178.73.210.219 thepiratebay.se www.thepiratebay.se thepiratebay.org www.thepiratebay.org
/etc/hosts FTW
besides using it when waiting for a DNS change to propagate over the Internet, I'm also using /etc/hosts for mapping my local virtual machines to a static local ip and it's great as I can easily access the virtual machines by their code-names.
I also have habbit to give names to my public machines that are not setup in the DNS zone file, so /etc/hosts come handy in this case as well.
take care,
- d