wget does not work most of the time

Issues related to configuring your network
centguy
Posts: 271
Joined: 2008/08/11 16:03:29

wget does not work most of the time

Post by centguy » 2015/04/19 14:23:42

Ever since I have upgraded to the faster network cable service, my
wget is misbehaving. It says

wget: unable to resolve host address

But rarely it can connect to a website and start to download an iso (a routine test for me). The download is fast, but then
I do not mind a slow download (before the network upgrade) as long as the connection is stable.

I believe it has to do with putting two lines in /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

But if I take out these two lines,
I cannot serve the web sites at all (or very slow connection) in firefox.

I am at a total loss right now.
I need to ssh to other machine but the small random success rate of connecting is upsetting me most of the time.

I have not have any solid networking knowledge in Linux.

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/19 14:53:01

Update: That's was for old CentOS 6.1. The newly installed CentOS 6.6 does not seems to have this problem.
If CentOS 6.6 still have this problem I will report back.
Thanks.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: wget does not work most of the time

Post by scottro » 2015/04/19 15:50:45

Thanks for the update. I'm pretty sure that as the original poster (OP) you can edit the thread title. If you feel it is no longer a problem, you can mark it SOLVED in the title. If not, and you wish to mark it solved, just mention it here in the thread and a moderator will do it.
New users should check the FAQ and Read Me First pages

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/21 01:23:28

I do not think the problem is solved in CentOS 6.6.

The default CentOS 6.6 installation setting will make wget works consistently.

However, on my firefox, it takes ages or impossible to connect to bcc, cnn, new york times as test website.

I experience the same thing with the old CentOS 6.1, where firefox will declare the websites are down or even google website is down. In that case
google-chrome seems a bit faster at resolving a websites probably chrome seems lighter than firefox. But firefox should work no matter what.

Disabling ipv6 on CentOS 6.1 will make firefox very fast at surfing to other websites, but the command line wget will behave
erratically, with most of the time unable to resolve a perfectly valid website.

As it is, I still endure the slow firefox connection but maintain the reliable wget
so that I can ssh to other machines to do my work.

The point is

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

in /etc/sysctl.conf solves firefox speed problem but wget will mulfunction.

Taking out these two lines
will cause firefox to be totally unusable in CentOS 6.1 but extremely slow in CentOS 6.6. But wget is always working.

I am at a loss. I cannot possibly keep commenting and uncommenting these two lines in the /etc/sysctl.conf.

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/21 10:11:36

I am studying


https://wiki.echocat.org/display/ECHOCA ... d+slow+DNS


but I am wondering if port 53 mentioned in that article is what I have to use on my system. If not, what number should I use?

Also I do not know what number to replace the following line:

nameserver 10.100.0.2

giulix63
Posts: 1305
Joined: 2014/05/14 10:06:37
Location: UK

Re: wget does not work most of the time

Post by giulix63 » 2015/04/21 12:40:56

Yes, TCP/UDP port 53 is used by DNS. It seems odd that a 2012 bug is still creating problems... if it's indeed related.
Anyway, the entry in /etc/resolv.conf is usually determined by dhclient based on input from the network configuration supplied by your ISP and corresponds to one or more of the ISP's DNS addresses or it could be one assigned to your system by your router (without additional info on your actual network topology is impossible to say for sure), if you have one. On the other hand, if you have been assigned a static IP address, the entire configuration should be under your direct control.
For experimenting, you can use one of Google's DNSs, 8.8.8.8 or 8.8.4.4; they'll be overwritten next time you reboot or restart the network, anyway. So,
/etc/resolv.conf

Code: Select all

nameserver 8.8.8.8
nameserver 8.8.4.4
should do the trick.
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/21 14:40:32

This is my observation so far.

Option A:
On CentOS 6.6 fresh install. The firefox is extremely slow in resolving website but wget seems stable and fast.
Once I start VPN to my company network, firefox is working reasonably fast, wget is stable but slower, presumaby I am using my company
network. This is a reasonably good option if I decide to use VPN at all times.

Option B:
Putting two lines of
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.all.disable_ipv6=1
in /etc/sysctl.conf
and reboot, firefox is okay and wget is okay. But then
once I start VPN to my company network, the wget will certainly break. I cannot even connect to my company computers.

I have to remember the mutually exclusive events!

This kind of trial and error is really tiring.
But then I know I just need to use Option A to get a stable connection to the outside world with a reasonable speed.

I do not have to make any significant compromise in CentOS before.
All these happened after the ISP service man came and forced me to upgrade to new and faster cable..
I have been spending quite a lot of time thinking over this issue. But without any theory, i won't go very far.

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: wget does not work most of the time

Post by TrevorH » 2015/04/21 18:52:24

It sounds to me like your machine is misconfigured for ipv6 support and thinks that it has an ipv6 connection that can be used when it doesn't work.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/22 00:25:40

May be. On the day of upgrade, the computer guy tested on the network on his Windows computer and concluded that it was okay.
And my Mac Book Pro did not have that problem since the network upgrade.
Or was it because my Mac was relying on wireless network?

The linux Mint 14 on a another laptop
was working fine too in terms of me not having to do anything to /sys/sysctl.conf. I cannot test the VPN on linux mint because
my company only provides (or that the juniper company) Juniper VPN ncsvc packages for CentOS Linux.

centguy
Posts: 271
Joined: 2008/08/11 16:03:29

Re: wget does not work most of the time

Post by centguy » 2015/04/22 00:26:47

How to properly configure my machine for ipv6 ?
I did the standard installation as usual.

Post Reply