greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.89k stars 475 forks source link

Request: DNS information to network block #2053

Open heitorPB opened 6 months ago

heitorPB commented 6 months ago

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

bim9262 commented 6 months ago

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.

MaxVerevkin commented 6 months ago

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

NetworkManager also does that.

jkauerl commented 6 months ago

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

bim9262 commented 6 months ago

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.

jkauerl commented 6 months ago

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

heitorPB commented 5 months ago

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

bim9262 commented 5 months ago

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