LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-09-2010, 06:49 AM   #1
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,501

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
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
--2010-11-09 13:48:14--  http://users.telenet.be/reggersjans
Resolving users.telenet.be (users.telenet.be)... ::ffff:74.117.221.11, 74.117.221.11
Connecting to users.telenet.be (users.telenet.be)|::ffff:74.117.221.11|:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
2010-11-09 13:48:16 ERROR 400: Bad Request.

repo@cannabis ~]$ curl http://users.telenet.be/reggersjans
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META http-equiv="Refresh" content="0;url=http://www.directnicparking.com/">
</HEAD>

<BODY>
    <!-- 400 Bad Request -->
    <!-- The hostname specified (users.telenet.be) was not found on this server. -->
    <!-- tigershark/3.0.128 at <A href="http://www.directnic.com/">dn-fh20.directnic.com</A> -->

    <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
    <!-- XXXXXX  Extra bytes to force IE to display this page  XXXXXX -->
    <!-- XXXXXX      (instead of its internal error page)      XXXXXX -->
    <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->

</BODY>
</HTML>
repo@cannabis ~]$
I can surf the sites with no problem.
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

Last edited by repo; 11-09-2010 at 07:13 AM.
 
Old 11-09-2010, 07:18 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,909

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Wrong dns resolution?
Quote:
host users.telenet.be
users.telenet.be has address 195.130.132.86
users.telenet.be has address 195.130.132.85

host 74.117.221.11
11.221.117.74.in-addr.arpa domain name pointer dn-fh20.directnic.com.

host 195.130.132.86
86.132.130.195.in-addr.arpa domain name pointer webcluster2b.telenet-ops.be
FYI both wget and curl work here (also Slackware current), using my local dns.

Regards
 
Old 11-09-2010, 07:28 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,501

Original Poster
Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Hi,

My local DNS gives the same output
Code:
root@cannabis repo]# host users.telenet.be
users.telenet.be has address 195.130.132.85
users.telenet.be has address 195.130.132.86
root@cannabis repo]#
Any idea why wget goes to 74.17.221.11 ?
I tried to change the DNS, but no go

Thank you
 
Old 11-09-2010, 07:50 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,909

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Do you have an entry for users.telenet.be in /etc/hosts?
 
1 members found this post helpful.
Old 11-09-2010, 10:42 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,501

Original Poster
Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Quote:
Originally Posted by bathory View Post
Do you have an entry for users.telenet.be in /etc/hosts?
No
But I added
Code:
195.130.132.85        users.telenet.be
And now it works.

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
 
Old 11-09-2010, 04:04 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,909

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
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
 
1 members found this post helpful.
Old 11-10-2010, 02:55 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,501

Original Poster
Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Thank you bathory
The problem was /etc/resolv.conf
I had
Code:
search beginnerslinux.org
as the first entry
After deleting this, everything works OK

Kind regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS - 400 Bad Request theking2 Linux - Software 1 06-10-2010 04:15 PM
Any ideas to pass the "ERROR 400: Bad Request." of WGET? frenchn00b Programming 1 04-19-2009 11:46 AM
squid - TCP_DENIED/400 error:invalid-request ffredrixson Linux - Server 1 03-12-2008 07:34 AM
httpd mod_securiry generating 400 bad request error lcornea Linux - Newbie 4 02-28-2008 08:40 AM
I'm getting an error 400 (Bad Request) jim.thornton Linux - Server 1 01-19-2008 11:42 PM


All times are GMT -5. The time now is 11:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration