curl and wget error 400 bad request
I use slackware current, and curl and wget give the following errors:
Code:
repo@cannabis ~]$ wget -r http://users.telenet.be/reggersjans Some sites work ok, others give the 400 error. However, when I use puppy in VM, there is no problem with wget or curl Any thoughts? Thank you |
Wrong dns resolution?
Quote:
Regards |
Hi,
My local DNS gives the same output Code:
root@cannabis repo]# host users.telenet.be I tried to change the DNS, but no go Thank you |
Do you have an entry for users.telenet.be in /etc/hosts?
|
Quote:
But I added Code:
195.130.132.85 users.telenet.be But I don't understand why wget and curl don't use the global dns server, and why it goes to 74.117.221.11 The problem is with several sites. ALso linuxquestions.org is redirected to 74.117.221.11 Other sites work ok Kind regards |
Hi,
wget and curl follow the order of the hosts line in /etc/nsswitch.conf. The default is "hosts: files dns", so they use first /etc/hosts and then dns trying to resolve a hostname. You can revert the order, so they use dns first and the hosts file afterwards, but it's better to leave it as is. Anyway, take a look at /etc/resolv.conf and add you local dns first, as it can resolve the hostname in question. Maybe the existing 1st dns server cache is corrupted. Regards |
Thank you bathory
The problem was /etc/resolv.conf I had Code:
search beginnerslinux.org After deleting this, everything works OK Kind regards |
All times are GMT -5. The time now is 11:34 AM. |