WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Apps downloading is pretty slow  (Read 25078 times)

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: Apps downloading is pretty slow
« Reply #45 on: August 24, 2020, 01:59:19 AM »
Hi !
Code: [Select]
tc@box:~$ cat /etc/resolv.conf
nameserver 192.168.55.1
which makes me think that it queries my router which queries DNS given by my ISP.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Apps downloading is pretty slow
« Reply #46 on: August 24, 2020, 02:12:53 AM »
Hi Sashank999
Yup, that's what it does. Try changing the contents to this:
Code: [Select]
nameserver 8.8.4.4or:
Code: [Select]
nameserver 4.2.2.4
Then see if things run any faster.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: Apps downloading is pretty slow
« Reply #47 on: August 24, 2020, 03:06:06 AM »
It didn't work as the file again changed nameserver to 192.168.55.1 .

aus9

  • Guest
Re: Apps downloading is pretty slow
« Reply #48 on: August 24, 2020, 04:06:22 AM »
Sashank999

if interested, my gateway is diff to yours. for me
Code: [Select]
cat /etc/resolv.conf
search localhost
nameserver 192.168.1.1
If you log into your router....hopefully you have a page for network settings (DLINK)
LAN IP address matches my above number
and I have DNS relay enabled......and I believe that takes me to ISP DNS

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Apps downloading is pretty slow
« Reply #49 on: August 24, 2020, 10:45:25 AM »
Hi Sashank999
Change the contents of the file. Don't forget to use the save command in the editor.

Do not reboot.
Do not restart your wireless adapter.

The changes should be detected immediately. Try both of those DNS servers and see if either on improves your Internet connection.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: Apps downloading is pretty slow
« Reply #50 on: August 24, 2020, 12:07:40 PM »
Hi Rich,

I have done as you said. Edited it and confirmed that it has the saved change in nameserver with cat /etc/resolv.conf. I did not restart my wifi adapter or reboot. The resolv.conf automatically changes.

@aus9

But I have a DASAN Router which is configured to use 192.168.55.1 as the router page.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Apps downloading is pretty slow
« Reply #51 on: August 24, 2020, 12:39:07 PM »
Hi Sashank999
So with the changes, is your web browsing any better? Are your downloads any faster?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: Apps downloading is pretty slow
« Reply #52 on: August 24, 2020, 01:41:31 PM »
The resolv.conf automatically changes.

Hi, Sashank999. I agree with Rich that trying a different DNS server is an important step in troubleshooting your issue. A slow DNS server can have a dramatic impact on page load speed. I've experienced this issue myself.

Some network managers try to be "helpful" and automatically change the contents of /etc/resolv.conf. Openvpn sometimes also changes /etc/resolv.conf without your permission. There are different ways to prevent unauthorized changes to /etc/resolv.conf. An easy way that will work regardless of your setup is to make the file immutable. Go ahead and edit /etc/resolv.conf to your liking, then do this:

Code: [Select]
$ tce-load -wi e2fsprogs
$ sudo chattr +i /etc/resolv.conf

Now the file will be left in peace (until you reboot or run sudo chattr -i /etc/resolv.conf) and you can see if the DNS server change helps your issue.
« Last Edit: August 24, 2020, 01:44:43 PM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Apps downloading is pretty slow
« Reply #53 on: August 24, 2020, 02:08:15 PM »
Hi Sashank999
... The resolv.conf automatically changes. ...
Did I misunderstand you?

Are you saying that the  /etc/resolv.conf  file changes back to  192.168.55.1  even though you did not reboot or restart your
wireless adapter?

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: Apps downloading is pretty slow
« Reply #54 on: August 25, 2020, 08:04:57 AM »
@GNUser
Thank You for the suggestion. I did it. But then chattr replied with :
Code: [Select]
chattr: Inappropriate ioctl for device while reading flags on /etc/resolv.confSo, I added -f flag(help by Google). Then it replied no messages and hence I thought all was good. Then again, it changed back to its original. I think it deleted the file and made another one instead of it.
I use no network managers. I just do
Code: [Select]
sudo wifi.sh -a & in my aterm and then close aterm and open firefox.

@Rich
Yes. That is what I mean. It just changes back to its original form.
« Last Edit: August 25, 2020, 08:06:45 AM by Sashank999 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Apps downloading is pretty slow
« Reply #55 on: August 25, 2020, 09:20:23 AM »
Hi Sashank999
Does this command produce any output:
Code: [Select]
cat /opt/wlan0.sh

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: Apps downloading is pretty slow
« Reply #56 on: August 25, 2020, 09:43:13 AM »
Sashank999, sorry chattr didn't work. Maybe your filesystem doesn't support it.

Try adding your desired DNS servers to the top of /usr/share/udhcpc/default.script like this, for example:

Code: [Select]
dns="1.1.1.1 1.0.0.1"
Then running wifi.sh

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 934
Re: Apps downloading is pretty slow
« Reply #57 on: August 25, 2020, 12:13:37 PM »
Hi, GNUser!

Handy tip, thanks in advance! Currently I'm not suffering from DNS losses, but who knows, what's behind the corner.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: Apps downloading is pretty slow
« Reply #58 on: August 25, 2020, 02:14:57 PM »
Hi, Shashank999. I figured out the problem with chattr: In TCL, the root file system (including /etc/resolv.conf) exists only in RAM. Apparently ext3 and ext4 filesystems (and perhaps also other filesystems on a physical harddrive) support the immutable flag, but RAM filesystem does not.

Assuming your /opt directory is persistent, this will work (if your /home is persistent but not /opt, adjust the steps accordingly):

Code: [Select]
$ cp /etc/resolv.conf /opt/resolv.conf
$ sudo rm /etc/resolv.conf
-> edit /opt/resolv.conf to taste
$ sudo chattr +i /opt/resolv.conf
$ sudo ln -s /opt/resolv.conf /etc/resolv.conf

Now your DNS settings are immutable 8) (until you reboot or run sudo chattr -i /opt/resolv.conf).
« Last Edit: August 25, 2020, 02:19:48 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: Apps downloading is pretty slow
« Reply #59 on: August 25, 2020, 02:36:30 PM »
You're welcome, jazzbiker. I hope it comes in handy sometime.

The trick with /usr/share/udhcpc/default.script is specific to DNS issues being caused by DHCP. The chattr trick has more general application--you can use it whenever you want to prevent unauthorized edits to a file (it is stronger than making the file read-only using chmod).
« Last Edit: August 25, 2020, 02:53:40 PM by GNUser »