i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Request: DNS information to network block

Open heitorPB opened this issue 1 year ago • 7 comments

I'd like to have DNS information available in the net block. Is this feasible?

heitorPB avatar May 10 '24 12:05 heitorPB

There are several ways that dns can be setup, but starting off with reading /etc/resolv.conf is a good start. Some dns resolves like systemd-resolved will put an entry like nameserver 127.0.0.53 and then do the resolution itself, although you can query to see which nameservers systemd-resolved is using.

bim9262 avatar May 12 '24 19:05 bim9262

Some dns resolves like systemd-resolved will put an entry like nameserver 127.0.0.53

NetworkManager also does that.

MaxVerevkin avatar May 13 '24 09:05 MaxVerevkin

Hi, is this a good first issue to start? Because if it is I would love to start working on it with only Rust!!

jkauerl avatar May 13 '24 21:05 jkauerl

Sure, we can start of just reading /etc/resolv.conf looking for nameserver entries. Later we can add in an option to pick if another resolver should be queried.

bim9262 avatar May 13 '24 23:05 bim9262

Added a PR #2058 looking at nameserver entries in /etc/resolv.conf.

jkauerl avatar May 29 '24 08:05 jkauerl

@bim9262 should this issue continue open to support other cases than resolved.conf? Like systemd-resolved and NetworkManager?

heitorPB avatar Jun 19 '24 22:06 heitorPB

Yes, good catch. It was just partially completed by #2058

bim9262 avatar Jun 19 '24 22:06 bim9262