downlading using wget fails

I'm trying to build Thrift library..It downloads some files from the Maven repo during the build process.
It failed while downloading a file called "ivy-2.2.0.jar"
Then I downloaded that file using my browser and I succeeded.
After that I tried to download the same file using wget but it failed.
What can be the reason for that?

What error message are you getting?

Here is the error:

$ wget http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
--2011-04-03 01:03:27--  http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
Resolving repo2.maven.org... failed: Name or service not known.
wget: unable to resolve host address �repo2.maven.org�

But i can download the file using my browser...

Hi,

Try...

$ wget --user-agent="" http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar

Regards,
Birei

do you use a proxy for your browser?

Hi

I have tried 'wget --user-agent="" ' but i get exactly the same error...

I don't have any proxy set up in my browser...

your system is not able to resolve the adress correctly... can you ping the url or traceroute it? have you tried a "nslookup" to the remote server?

Yes, I can ping the host and also nslookup resolves the host address...

but wget can't do it... you have to look at this more closely.
GNU Wget Manual - Startup File
maybe the settinds in ".wgetrc" are faulty...

Another clue is:

-------------
$ nslookup repo2.maven.org
Server:		192.168.2.1
Address:	192.168.2.1#53

Non-authoritative answer:
Name:	repo2.maven.org
Address: 207.223.240.88
-----------
$ wget http://207.223.240.88/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
--2011-04-03 12:06:51--  http://207.223.240.88/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
Connecting to 207.223.240.88:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2011-04-03 12:06:52 ERROR 403: Forbidden.
------------

I think there's a problem with my wget's host resolution... But also there's another problem as seen above: When I try downloading with the resolved ip, it gives forbidden error

Hi,

I know this answer is similar to my last one, but here I paste the commands in my system. It works in the last example so I can't figure your problem.

$ wget http://207.223.240.88/maven2/org/apa...-2.0.0-rc2.jar
--2011-04-03 12:22:57--  http://207.223.240.88/maven2/org/apa...-2.0.0-rc2.jar
Connecting to 207.223.240.88:80... conectado.
Petici�n HTTP enviada, esperando respuesta... 403 Forbidden
2011-04-03 12:22:58 ERROR 403: Forbidden.
$ wget http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
--2011-04-03 12:23:57--  http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
Resolviendo repo2.maven.org... 207.223.240.88
Connecting to repo2.maven.org|207.223.240.88|:80... conectado.
Petici�n HTTP enviada, esperando respuesta... 403 Forbidden
2011-04-03 12:23:58 ERROR 403: Forbidden.
$ wget --user-agent="" http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
--2011-04-03 12:25:12--  http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.0.0-rc2/ivy-2.0.0-rc2.jar
Resolviendo repo2.maven.org... 207.223.240.88
Connecting to repo2.maven.org|207.223.240.88|:80... conectado.
Petici�n HTTP enviada, esperando respuesta... 200 OK
Longitud: 893199 (872K) [application/java-archive]
Saving to: `ivy-2.0.0-rc2.jar'

100%[============================================================>] 893.199      265K/s   in 3,8s    

2011-04-03 12:25:16 (229 KB/s) - `ivy-2.0.0-rc2.jar' saved [893199/893199]

Regards,
Birei

Yes, with the --user-agent="" and host name to ip conversion, it works for me too.
But it still fails with the host name...

Somehow your wget is using different DNS settings than the rest of your system. Have you checked your wgetrc files as requested?

i was just to tired to ask this, again...