1

My question is: what is the difference between DNS and the static resolution method based on /etc/hosts in name resolving during an HTTPS connection? In order to connect to a site using https the first action is ask to DNS for the ip of the requested server (if there are no record in /etc/hosts for that domain).

I'm trying to figure out why I can connect to a server only with the right ip inside /etc/hosts file (and not using DNS).

The URL of the server is "https://www.ovh.it/managerv3/login.pl" and I cannot connect to it if there's not a record "94.23.64.34 www.ovh.it" in /etc/hosts. There's also another fact that I can't explain: when I'm connected to my ADSL I've to use this trick, but when I use tethering through my phone everything works fine (also without changing /etc/hosts).

If I ping the domain www.ovh.it the result is the same on both connections:

PING www.ovh.it (198.27.92.4): 56 data bytes (ADSL)
PING www.ovh.it (198.27.92.4): 56 data bytes (TETHERING)

If I ping the domain ovh.it the result is the same on both connections:

PING ovh.it (94.23.64.34): 56 data bytes (ADSL)
PING ovh.it (94.23.64.34): 56 data bytes (TETHERING)

Using ping (ICMP protocol) the result of the name resolution is the same on both connections. Why using a browser and an HTTPS connection I can't connect to the server with ADSL and there are no problem with TETHERING of my SMATPHONE? And why manually inserting the ip on ovh.it in /etc/hosts it works also connecting with my ADSL?

Additional informations: I tried with Safari, Chrome and Firefox and the result is the same. I tried to reboot laptop and wifi-router (ADSL router). I also tried with a different laptop.

1 Answer 1

4

I think that you probably know the answer to your question. The difference is that /etc/hosts is STATIC whereas DNS is DYNAMIC. DNS lookups are good for a specified time period after which the client will re-query. DNS servers can also be smart about what they return - acting as simple load spreaders for example or failing over to backup servers.

In your case, clearly either the client PC (some kind of Linux? You don't say) or the ADSL router would appear to be wrongly configured.

Firstly check that you haven't put some kind of fixed config on the network card for the PC. Second check the configuration of the router to make sure it gives a valid DNS server. If the PC is set to use DHCP from the router, check if the router is reporting itself as a DNS server (very common for consumer grade routers). If it is, change the DHCP config to give the client PC's proper DNS servers such as your ISP, Google or best of all, OpenDNS.

The other possibility I can think of is that you are using your ISP's DNS when connected via ADSL and that it is broken. Not that uncommon. Change to use OpenDNS or Google DNS to see if that fixes the issue.

Although using the hosts file may appear to work, you are fixing the IP address and a service like OVH is likely to use several sets of addresses that you wont be getting access to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .