Gnus development mailing list
 help / color / mirror / Atom feed
* Refresh of DNS servers
@ 2004-02-02  8:25 Ralf Angeli
  2004-02-02 14:47 ` Kai Grossjohann
  2004-02-02 16:13 ` Jeremy Maitin-Shepard
  0 siblings, 2 replies; 13+ messages in thread
From: Ralf Angeli @ 2004-02-02  8:25 UTC (permalink / raw)


Hello everybody,

Gnus seems to cache DNS servers.  This is fine as long as the same DNS
servers are used all the time.  But if Gnus is used on a notebook with
changing PPP and Ethernet connections it can become a problem.  I am
in such a situation and have to restart Gnus whenever I am switching
to one or the other connection type.  If Gnus is not restarted it uses
the old DNS servers.

Is there a way to either manually or automatically refresh the list
of DNS servers?

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02  8:25 Refresh of DNS servers Ralf Angeli
@ 2004-02-02 14:47 ` Kai Grossjohann
  2004-02-02 19:40   ` Ralf Angeli
  2004-02-02 16:13 ` Jeremy Maitin-Shepard
  1 sibling, 1 reply; 13+ messages in thread
From: Kai Grossjohann @ 2004-02-02 14:47 UTC (permalink / raw)


Ralf Angeli <dev.null@iwi.uni-sb.de> writes:

> Gnus seems to cache DNS servers.  This is fine as long as the same DNS
> servers are used all the time.  But if Gnus is used on a notebook with
> changing PPP and Ethernet connections it can become a problem.  I am
> in such a situation and have to restart Gnus whenever I am switching
> to one or the other connection type.  If Gnus is not restarted it uses
> the old DNS servers.

Does it really do that?  I'd be surprised.

Maybe it's sufficient to hit ^ to go to the servers buffer, then use D
to deny the servers, then C to close them, then O to open them.  Does
this work?  (I think one of the steps D, C, O is unnecessary, but I
don't know which one.)

Kai



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02  8:25 Refresh of DNS servers Ralf Angeli
  2004-02-02 14:47 ` Kai Grossjohann
@ 2004-02-02 16:13 ` Jeremy Maitin-Shepard
  2004-02-02 19:40   ` Ralf Angeli
  1 sibling, 1 reply; 13+ messages in thread
From: Jeremy Maitin-Shepard @ 2004-02-02 16:13 UTC (permalink / raw)


Refer to dns.el.

-- 
Jeremy Maitin-Shepard



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 14:47 ` Kai Grossjohann
@ 2004-02-02 19:40   ` Ralf Angeli
  2004-02-02 21:02     ` Derrell.Lipman
  0 siblings, 1 reply; 13+ messages in thread
From: Ralf Angeli @ 2004-02-02 19:40 UTC (permalink / raw)


* Kai Grossjohann (2004-02-02) writes:

> Ralf Angeli <dev.null@iwi.uni-sb.de> writes:
>
>> Gnus seems to cache DNS servers.  This is fine as long as the same DNS
>> servers are used all the time.  But if Gnus is used on a notebook with
>> changing PPP and Ethernet connections it can become a problem.  I am
>> in such a situation and have to restart Gnus whenever I am switching
>> to one or the other connection type.  If Gnus is not restarted it uses
>> the old DNS servers.
>
> Does it really do that?  I'd be surprised.

Here it does.  I tested it the following way:

1. Unplugged the Ethernet cable of the notebook (and drove home (c;)

2. Disabled the Ethernet interface with ‘ifconfig eth0 down’

3. Put in the following iptables rule to log the DNS traffic:

   iptables -A OUTPUT -o ppp0 -p udp --dport 53 -j LOG

4. Started the PPP interface by dialing a provider

5. Tried to refresh Groups by hitting ‘g’ in the group buffer

The result showing up in /var/log/messages was a query to the name
server I originally configured for the eth0 interface and not the name
servers for the dial-up connection.

> Maybe it's sufficient to hit ^ to go to the servers buffer, then use D
> to deny the servers, then C to close them, then O to open them.  Does
> this work?  (I think one of the steps D, C, O is unnecessary, but I
> don't know which one.)

I tried it and I am afraid that it did not work.

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 16:13 ` Jeremy Maitin-Shepard
@ 2004-02-02 19:40   ` Ralf Angeli
  2004-02-02 22:38     ` Jeremy Maitin-Shepard
  0 siblings, 1 reply; 13+ messages in thread
From: Ralf Angeli @ 2004-02-02 19:40 UTC (permalink / raw)


* Jeremy Maitin-Shepard (2004-02-02) writes:

> Refer to dns.el.

Could you please be a bit more specific?

I tried to get a hold on the variable ‘dns-servers’.  But neither ‘C-h
v dns-servers RET’ nor ‘(print dns-servers)’ worked.  Besides I
recognized the function ‘dns-parse-resolv-conf’ which I can test
tomorrow if this is what you meant.

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 19:40   ` Ralf Angeli
@ 2004-02-02 21:02     ` Derrell.Lipman
  2004-02-03  8:18       ` Ralf Angeli
  0 siblings, 1 reply; 13+ messages in thread
From: Derrell.Lipman @ 2004-02-02 21:02 UTC (permalink / raw)


Ralf Angeli <dev.null@iwi.uni-sb.de> writes:

> 2. Disabled the Ethernet interface with ‘ifconfig eth0 down’
>
> 3. Put in the following iptables rule to log the DNS traffic:
>
>    iptables -A OUTPUT -o ppp0 -p udp --dport 53 -j LOG
>
> 4. Started the PPP interface by dialing a provider
>
> 5. Tried to refresh Groups by hitting ‘g’ in the group buffer
>
> The result showing up in /var/log/messages was a query to the name
> server I originally configured for the eth0 interface and not the name
> servers for the dial-up connection.

The name servers are typically listed in /etc/resolv.conf which is one of the
configuration files for the resolver.  The resolver library [see resolver(3)]
which most applications that needs DNS services links with, only reads its
configuration files when res_init() is called, which typically occurs only
when the very first resolver services are required.  It's likely not gnus
that's caching the old nameserver, but rather the resolver library in emacs.
Since emacs is still running, the resolver library is not reinitializing.  I
don't know of any way to force a reinitialization, although one may exist
(some signal, possibly).

Derrell



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 19:40   ` Ralf Angeli
@ 2004-02-02 22:38     ` Jeremy Maitin-Shepard
  2004-02-03  7:58       ` Ralf Angeli
  0 siblings, 1 reply; 13+ messages in thread
From: Jeremy Maitin-Shepard @ 2004-02-02 22:38 UTC (permalink / raw)


Set `dns-servers' to nil to force dns.el to reload resolv.conf.

-- 
Jeremy Maitin-Shepard



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 22:38     ` Jeremy Maitin-Shepard
@ 2004-02-03  7:58       ` Ralf Angeli
  2004-02-06 19:32         ` Xavier Maillard
  0 siblings, 1 reply; 13+ messages in thread
From: Ralf Angeli @ 2004-02-03  7:58 UTC (permalink / raw)


* Jeremy Maitin-Shepard (2004-02-02) writes:

> Set `dns-servers' to nil to force dns.el to reload resolv.conf.

Hm, that doesn't help.  It even seems that `dns.el' isn't loaded
after starting Gnus because all variables and functions defined
therein are void unless one explicitely loads the library.

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-02 21:02     ` Derrell.Lipman
@ 2004-02-03  8:18       ` Ralf Angeli
  2004-02-03 14:42         ` Derrell.Lipman
  2004-02-04 16:58         ` William M. Perry
  0 siblings, 2 replies; 13+ messages in thread
From: Ralf Angeli @ 2004-02-03  8:18 UTC (permalink / raw)


* Derrell Lipman (2004-02-02) writes:

> The name servers are typically listed in /etc/resolv.conf which is one of the
> configuration files for the resolver.  The resolver library [see resolver(3)]
> which most applications that needs DNS services links with, only reads its
> configuration files when res_init() is called, which typically occurs only
> when the very first resolver services are required.  It's likely not gnus
> that's caching the old nameserver, but rather the resolver library in emacs.
> Since emacs is still running, the resolver library is not reinitializing.  I
> don't know of any way to force a reinitialization, although one may exist
> (some signal, possibly).

This sounds reasonable.  Does anybody have a hint where I could start
to look for this stuff?  I grepped the Gnus and Emacs source
directories for "dns", "res_init" and variations of "nameserv" and
"resolv" but this didn't yield a usable result (I only found some
utility functions in `net-utils.el'.  Maybe I missed something?).  I
also tried to dig into `gnus-group-get-new-news' but got lost
somewhere in the middle.

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-03  8:18       ` Ralf Angeli
@ 2004-02-03 14:42         ` Derrell.Lipman
  2004-02-04 16:58         ` William M. Perry
  1 sibling, 0 replies; 13+ messages in thread
From: Derrell.Lipman @ 2004-02-03 14:42 UTC (permalink / raw)


Ralf Angeli <dev.null@iwi.uni-sb.de> writes:

> This sounds reasonable.  Does anybody have a hint where I could start
> to look for this stuff?  I grepped the Gnus and Emacs source
> directories for "dns", "res_init" and variations of "nameserv" and
> "resolv" but this didn't yield a usable result (I only found some
> utility functions in `net-utils.el'.  Maybe I missed something?).  I
> also tried to dig into `gnus-group-get-new-news' but got lost
> somewhere in the middle.

res_init() is not typically called directly by the application; rather it is
called by the first resolver function that is used.  Do "man resolver" for a
list of the functions that you can grep for in the source (or you can search
for "res_" and "dn_" since they all start with one of those).

Actually, those functions may not be called directly from the emacs source at
all.  Something like "gethostbyname() may be called, which indirectly calls
the resolver.

Derrell



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-03  8:18       ` Ralf Angeli
  2004-02-03 14:42         ` Derrell.Lipman
@ 2004-02-04 16:58         ` William M. Perry
  2004-02-05  8:28           ` Ralf Angeli
  1 sibling, 1 reply; 13+ messages in thread
From: William M. Perry @ 2004-02-04 16:58 UTC (permalink / raw)
  Cc: ding

Ralf Angeli wrote:

>* Derrell Lipman (2004-02-02) writes:
>
>  
>
>>The name servers are typically listed in /etc/resolv.conf which is one of the
>>configuration files for the resolver.  The resolver library [see resolver(3)]
>>which most applications that needs DNS services links with, only reads its
>>configuration files when res_init() is called, which typically occurs only
>>when the very first resolver services are required.  It's likely not gnus
>>that's caching the old nameserver, but rather the resolver library in emacs.
>>Since emacs is still running, the resolver library is not reinitializing.  I
>>don't know of any way to force a reinitialization, although one may exist
>>(some signal, possibly).
>>    
>>
>
>This sounds reasonable.  Does anybody have a hint where I could start
>to look for this stuff?  I grepped the Gnus and Emacs source
>directories for "dns", "res_init" and variations of "nameserv" and
>"resolv" but this didn't yield a usable result (I only found some
>utility functions in `net-utils.el'.  Maybe I missed something?).  I
>also tried to dig into `gnus-group-get-new-news' but got lost
>somewhere in the middle.
>  
>
You would need to make C level changes.  And is (probably?) going to 
vary from OS to OS.  I am pretty sure you can do it on linux by just doing:

if (res_state && (res_state->options & RES_INIT))
{
   res_state->options |= ~RES_INIT;
   res_init();
}

Solaris is similar.  There are also some tricks you could play to notice 
this by enumerating the interfaces and seeing if any of them are 
dynamically assigned.  Hrmm... linux doesn't appear to support that.  
Solaris does though. ;)

-bp



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-04 16:58         ` William M. Perry
@ 2004-02-05  8:28           ` Ralf Angeli
  0 siblings, 0 replies; 13+ messages in thread
From: Ralf Angeli @ 2004-02-05  8:28 UTC (permalink / raw)


* William M. Perry (2004-02-04) writes:

> Solaris is similar.  There are also some tricks you could play to notice 
> this by enumerating the interfaces and seeing if any of them are 
> dynamically assigned.  Hrmm... linux doesn't appear to support that.  
> Solaris does though. ;)

Maybe it really is a problem with different interfaces.  This morning
I used two different Internet providers for dial-up connections and
Gnus/Emacs didn't have any problems with different name servers.  It
seems that it just is not able to cope with changing network
interfaces.

-- 
Ralf



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Refresh of DNS servers
  2004-02-03  7:58       ` Ralf Angeli
@ 2004-02-06 19:32         ` Xavier Maillard
  0 siblings, 0 replies; 13+ messages in thread
From: Xavier Maillard @ 2004-02-06 19:32 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

On  3 Feb 2004, Ralf Angeli wrote:

> * Jeremy Maitin-Shepard (2004-02-02) writes:
> 
> > Set `dns-servers' to nil to force dns.el to reload resolv.conf.
> 
> Hm, that doesn't help.  It even seems that `dns.el' isn't loaded
> after starting Gnus because all variables and functions defined
> therein are void unless one explicitely loads the library.

I second this. Gnus here and at work _doesn't_ load dns.el. Maybe the
trick is here : load dns.el at gnus startup ?

Regards,
-- 
Xavier MAILLARD (GnuPG: 1024D/1E028EA5)
EmacsOS user (http://emacsfr.org)
APRIL (http://www.april.org)


[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-02-06 19:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-02  8:25 Refresh of DNS servers Ralf Angeli
2004-02-02 14:47 ` Kai Grossjohann
2004-02-02 19:40   ` Ralf Angeli
2004-02-02 21:02     ` Derrell.Lipman
2004-02-03  8:18       ` Ralf Angeli
2004-02-03 14:42         ` Derrell.Lipman
2004-02-04 16:58         ` William M. Perry
2004-02-05  8:28           ` Ralf Angeli
2004-02-02 16:13 ` Jeremy Maitin-Shepard
2004-02-02 19:40   ` Ralf Angeli
2004-02-02 22:38     ` Jeremy Maitin-Shepard
2004-02-03  7:58       ` Ralf Angeli
2004-02-06 19:32         ` Xavier Maillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).