Refreshing server IP address Topic is solved

Board for discussions around the Epyrus mail and news client.

Moderator: athenian200

andy80
Moonbather
Moonbather
Posts: 53
Joined: 2015-01-04, 08:21
Location: Beijing

Refreshing server IP address

Unread post by andy80 » 2022-10-03, 14:38

Hi all,

I use Epyrus on my laptop, that I use in the office and at home. If I launch Epyrus while I am in the office, it gets as IP address for the server a local IP address (of the type 192.168.x.y), so when I suspend my laptop to go back home and then I resume it, Epyrus doesn't recognize that the network has changed and doesn't refresh the server's address. As a result, it can't connect to the server to check mails (as it should use the server's external IP to connect to the server, not the local one).

In the Epyrus about:config page I see the entry "network.dnsCacheExpiration" that is set to the default value 60 (1 hour, I presume); still, even if more than 1 hour has passed from the suspension and from the resume, Epyrus still uses the cached entry. I tried to use "nslookup" to check the IP of the server while being at home after resuming the laptop, and I correctly get the external one.

Is there a simple way to force Epyrus to refresh the server IP, without closing it and launching it again?

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 933
Joined: 2021-01-26, 11:18

Re: Refreshing server IP address

Unread post by Kris_88 » 2022-10-03, 18:23

You can toggle one of the network.dns preferences.
F.e. "network.dns.disablePrefetch" or "network.dnsCacheEntries".
This will clean the dns cache (for the Goanna platform itself).
Another way is to call notifyObservers from the addon.
Services.obs.notifyObservers(null, "network:link-status-changed", "changed");

And do not forget "ipconfig /flushdns".

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1498
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Refreshing server IP address

Unread post by athenian200 » 2022-10-04, 00:16

I never really noticed a situation like this because my development environment is on a desktop PC that's always connected to the same network...

If there's a way to change the default behavior of Epyrus in the future to not do this, I'd be open to it. We are still in alpha technically, and working out obvious little bugs like this that I would miss in my own environment is the kind of thing I want to address.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Refreshing server IP address

Unread post by Moonchild » 2022-10-04, 00:27

This has very little to do with Epyrus as an application. The issue seems to be with the way the OS resumes from standby when the networking has changed, i.e. something at the system level.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

andy80
Moonbather
Moonbather
Posts: 53
Joined: 2015-01-04, 08:21
Location: Beijing

Re: Refreshing server IP address

Unread post by andy80 » 2022-10-04, 02:36

Thanks for the suggestions; I will try them later today.

About my system: I am running Epyrus on openSUSE Tumbleweed; network changes since I connect wireless at home while via ethernet in the office.
About DNS caching at OS level, I will try to check whether nscd is the cause of this problem: since the mail server also provides a web interface, I can try with Pale Moon whether it is also affected by some OS DNS caching.

User avatar
Pentium4User
Board Warrior
Board Warrior
Posts: 1111
Joined: 2019-04-24, 09:38

Re: Refreshing server IP address

Unread post by Pentium4User » 2022-10-04, 05:13

First figure out if you use the right DNS server. Some systems use systemd-resolved and maybe it still tries to use DNS server that are not reachable from the actual network.

Then make sure the IP configuration is right and no addresses from the other network are still assigned.
The profile picture shows my Maico EC30 E ceiling fan.

andy80
Moonbather
Moonbather
Posts: 53
Joined: 2015-01-04, 08:21
Location: Beijing

Re: Refreshing server IP address

Unread post by andy80 » 2022-10-04, 13:35

I made few more tests about the issue and the culprit of Epyrus's behavior is nscd; Epyrus was just the program exposing the issue with the caching of the DNS entry for the mail server. The interesting thing is that a "rcnscd restart" is not enough to clear its cache but I need to stop it and then start it again.
What misled me yesterday is that both nslookup and dig gave the expected IP address for the mail server, without using nscd's cache; also, after I tried to restart nscd, Epyrus was still failing to connect to the mail server, but Pale Moon worked fine in accessing the web interface. Now I wonder why...

Regarding the IP and DNS configurations, the DNS server is correct (nslookup and dig work without problem at both home and in the office, as well as accessing other web sites) and I can access websites and check other mail accounts; systemd-resolved is not installed, so it can't be the cause of the issue.

Locked