Site displays with Curl but not within the browser

3

I've set up a dev-enviroment on Debian 7 and installed the following services:

  • Apache
  • Bind9

I have one site that is reachable through "asix.debian.local". I've set up the zone and added NS and A registry to the db.debian.local file.

Everything is working, this is the response I get with curl:

"curl asix.debian.local" Apache default

It works!!

Aquest es la pagina de benvinguda de ASIX

So I guessed I got everything up and working, but when I type in the same URL in browser, I get "Server not found error - Iceweasel can't find the server at asix.debian.local."

Only nameserver in /etc/resolv.conf is the local IP of the server.

Why can't browser reach the website if curl did?

Any help is appreciated.

Thanks

Borjante

Posted 2015-06-07T17:41:02.583

Reputation: 133

Are you use browser on the same machine you use curl? – Romeo Ninov – 2015-06-07T18:21:38.497

Yes, both on Debian 7, it really makes no sense. – Borjante – 2015-06-07T18:22:12.520

I mean on the same machine, no the same OS – Romeo Ninov – 2015-06-07T18:23:00.680

Yes, they are.. – Borjante – 2015-06-07T18:25:08.667

What you have configured in /etc/nsswitch.conf? Did you try to add record in /etc/hosts? – Romeo Ninov – 2015-06-07T18:26:29.957

/etc/nsswitch.conf hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4 – Borjante – 2015-06-07T18:28:06.583

And if I define the hosts in /etc/hosts manually it does work :S – Borjante – 2015-06-07T18:29:13.127

Answers

2

For such case please add line in /etc/nsswitch.conf

hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4

to be

hosts: dns files mdns4_minimal [NOTFOUND=return] mdns4

Romeo Ninov

Posted 2015-06-07T17:41:02.583

Reputation: 2 062

Did it sir, still the same, curl works, ping works, wget works, just the browser ain't finding the server. It's really strange :S – Borjante – 2015-06-07T18:34:06.343

3Please restart the browser and try again, because some time browser cache DNS requests – Romeo Ninov – 2015-06-07T18:35:51.700

1I feel so stupid... That's what happens when you don't stop to think.

I knew it was a stupid thing. Thanks a lot, it works now – Borjante – 2015-06-07T18:37:59.267

2@Borjante, there are no stupid questions, there can be stupid answers :) And sometime everyone just stuck – Romeo Ninov – 2015-06-07T18:40:18.693

1You are completely right – Borjante – 2015-06-07T18:41:26.493