TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Give HN: *.til.io resolves to 127.0.0.1

46 pointsby jtoljover 10 years ago

21 comments

sk5tover 10 years ago
Relying on a magical domain "just for development" is extremely careless behavior. Even assuming that these addresses always resolved to 127.0.0.1 with no interruption, slowdown, or redirection ever, do you really want to be leaking private hostnames etc. over the internet? Simply run a local DNS with forwarding, create a zone or two for your internal machines, all done. And you can even have other record types besides A and PTR...
评论 #8642941 未加载
评论 #8644526 未加载
评论 #8642951 未加载
评论 #8646722 未加载
sligover 10 years ago
See also: <a href="http://xip.io/" rel="nofollow">http:&#x2F;&#x2F;xip.io&#x2F;</a><p>&gt; xip.io is a magic domain name that provides wildcard DNS for any IP address<p>So you can test stuff on your phone&#x2F;tablet without messing with &#x27;hosts&#x27; file, for instance: myapp.192.168.0.1.xip.io will resolve to 192.168.0.1.
评论 #8642845 未加载
评论 #8642910 未加载
评论 #8642917 未加载
评论 #8643027 未加载
评论 #8642877 未加载
saidajigumiover 10 years ago
I&#x27;ll recommend using dnsmasq plus some local resolver configuration to set up your own host-local magic domain, eliminating the need for reliance on a third-party magic domain.<p>Pow[1] by the Basecamp folks provides a nicely packaged version of dnsmasq tooling for Rack &amp; Rails apps. See also, the guard-pow and powder gems which make using Pow even nicer.<p>For other cases (and the DIYers among us) Thomas Sutton wrote up instructions for setting up dnsmasq[2] on OS X for app development. IIRC, the dnsmasq setup should be identical on other *nix flavors. Your local resolver configuration may vary, but this guide will get you pointed the right direction. I highly recommend reading [2] even just as a guide to understand&#x2F;demystify what Pow does under the hood.<p>The dnsmasq setup can also be used for tools like Dokku[3], a Heroku-style service you can run in (e.g.) a local VM.<p>[1] <a href="http://pow.cx/" rel="nofollow">http:&#x2F;&#x2F;pow.cx&#x2F;</a><p>[2] <a href="http://passingcuriosity.com/2013/dnsmasq-dev-osx/" rel="nofollow">http:&#x2F;&#x2F;passingcuriosity.com&#x2F;2013&#x2F;dnsmasq-dev-osx&#x2F;</a><p>[3] <a href="https://github.com/progrium/dokku" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;progrium&#x2F;dokku</a>
评论 #8644139 未加载
Sponeover 10 years ago
If you use Vagrant for development, there are some plugins that will modify your HOSTS file automatically when you start your Vagrant VM. See for instance <a href="https://github.com/cogitatio/vagrant-hostsupdater" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cogitatio&#x2F;vagrant-hostsupdater</a>
spacefightover 10 years ago
It resolves at least to that for now. Until someone forgets to pay the bill (for various reasons), runs out of money in their bank account to keep it up or whatever reason there might be.<p>Then devs around the globe scramble to find out what data might have been leaked and to whom.
评论 #8643082 未加载
rdtscover 10 years ago
So does localhost
rikkusover 10 years ago
Or, if you have your own domain, set up a wildcard in your DNS, which could be external (I use cloudflare - free and reliable).<p>Example:<p>I own rikk.us and want to be able to set up many websites on a few machines with my network, so:<p>I point ✱.l.rikk.us to my laptop and now I can set up as many websites as I like on my laptop, so long as they have a binding matching ✱.l.rikk.us, and have them all work just as if they were on separate hosts.<p>This allows me to make testsite1.l.rikk.us, testsite2.l.rikk.us, oh.bugger.i.broke.it.l.rikkus.us, etc.<p>✱ Sorry for the heavy asterisks but I don&#x27;t know how to write a normal one without it triggering &lt;em&gt;
e0mover 10 years ago
This looks like another .lvh.me Although it&#x27;s nice to have a backup.<p>I&#x27;ve found this invaluable when testing subdomains. Each of our accounts gets their own subdomain and testing that is a huge pain with a hosts file (need to explicitly map each one).<p>The wildcard nature of .til.io or .lvh.me is key.<p>The only issue I&#x27;ve noticed with 192.168.1.101.xip.io is that if your server code splits domains on dots and expects things to be in the &quot;nth&quot; place then things can go wrong (cough cough Rails).<p>The other thing this is super useful for is testing subdomains locally from a mobile device.
seanp2k2over 10 years ago
OT, but someone should start the .JS TLD for the tons of useful javascript libs out there. How awesome would it be to just go to Angular.js or node.js and have that be their actual site?
评论 #8642939 未加载
评论 #8643003 未加载
评论 #8643069 未加载
评论 #8642943 未加载
jhggover 10 years ago
We have something very similar at our workplace. *.l.tsl.io resolves to localhost. We usually use it to test hostnames[1] on our django projects on the the local developeent server. Definitely beats having to add a lot of records to &#x2F;etc&#x2F;hosts.<p>[1]: <a href="http://django-hosts.readthedocs.org/en/latest/" rel="nofollow">http:&#x2F;&#x2F;django-hosts.readthedocs.org&#x2F;en&#x2F;latest&#x2F;</a>
drivingmenutsover 10 years ago
I usually just use the real sitename with a .vm tld if I&#x27;m working in local dev space.<p>If it turns out that someone starts up a .vm tld for real, well, no loss. I&#x27;ll just switch to something else.<p>There&#x27;s no right and no wrong way to do this on your local machine as long as you don&#x27;t break the internet for everyone else and as long as it&#x27;s repeatable&#x2F;undoable.
评论 #8643685 未加载
Kiroover 10 years ago
Can someone explain what the puprose is?
评论 #8642861 未加载
评论 #8642851 未加载
devoldmxover 10 years ago
I have used this for a while and it works fine. I understand that it is not for every project, but you can set up quickly an app.<p><a href="https://ngrok.com/" rel="nofollow">https:&#x2F;&#x2F;ngrok.com&#x2F;</a>
jtoljover 10 years ago
I got tired of editing my host file for local development. Have been meaning to do this for a while, but I never had a domain name short enough so as not to be annoying to type.
评论 #8642794 未加载
jongalloway2over 10 years ago
<a href="http://readme.localtest.me/" rel="nofollow">http:&#x2F;&#x2F;readme.localtest.me&#x2F;</a>
sildurover 10 years ago
Also, <a href="http://whatever.new/" rel="nofollow">http:&#x2F;&#x2F;whatever.new&#x2F;</a>
tootieover 10 years ago
How does this work? Isn&#x27;t 127.0.0.1 a loopback? How does it get to the internet?
评论 #8642949 未加载
评论 #8642933 未加载
swalshover 10 years ago
This is pretty cool. Thanks, will be using.
spacefightover 10 years ago
Well, www.til.io doesn&#x27;t, for a start.
评论 #8643085 未加载
dingalingover 10 years ago
Ingenious idea, but no AAAA RR for ::1?<p>In 2014?
评论 #8643716 未加载
_mikzover 10 years ago
like lvh.me. also check xip.io