Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It is safe to use lvh.me instead of localhost for testing?

Tags:

I wonder whether is safe to use lvh.me instead of localhost when developing locally, since lvh.me must be resolved and the IP may change over time.

The goal of using lvh.me is to be able to handle subdomains, since localhost does not have top level domain.

like image 692
Josu Goñi Avatar asked Jul 29 '18 18:07

Josu Goñi


People also ask

What is LVH app?

http://lvh.me is a free service that resolves itself along with all subdomains to localhost . There's nothing to install or run. In fact, if you tried to visit that site it would fail unless you happened to have a local web app running on port 80. If you run host lvh.me you can see that it maps back to 127.0.

Whats lvh me?

Left ventricular hypertrophy, or LVH, is a term for a heart's left pumping chamber that has thickened and may not be pumping efficiently. Sometimes problems such as aortic stenosis or high blood pressure overwork the heart muscle.

What is LVH me in rails?

Plan A: lvh.me In the past, I've used lvh.me, a domain that's pointed at localhost. If you have a local server running on port 3000, http://lvh.me:3000 will get your server. It has a wildcard DNS record, so [anything]. lvh.me will point to localhost. Here's some more info about lvh.me.


1 Answers

Unless you are the maintainer of lvh.me, you can not be sure it will not disappear or change its RRs for lvh.me.

You can use localhost.localdomain instead of localhost, by adding the following lines in your hosts file:

127.0.0.1 localhost localhost.localdomain ::1 localhost localhost.localdomain 

This is better than using lvh.me because:

  • you may not always have access to a DNS resolver, when developing
  • lvm.me does not answer with a local IPv6 address corresponding to your local host, only with the IPv4 address 127.0.0.1
  • some ISPs DNS resolvers block answers corresponding to private addresses space, for security purpose (to avoid leaking internal informations)

Since you said in a comment that you do not want to update the host file, you have no mean to be sure that lvh.me will always work for your developers. Therefore, to answer your question: it is not safe. You may register a domain for yourself, but as I said before, some resolvers will block answers corresponding to private addresses space.

like image 86
Alexandre Fenyo Avatar answered Oct 20 '22 16:10

Alexandre Fenyo