orf / orf/gping

Feature Request: Ping All A Records for a DNS Hostname

Open
#591 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
12.7k
Forks
366
Avg merge
7d 7h
Merged PRs (30d)
1

Description

When a DNS hostname is supplied as a target, gping should resolve all of its IPv4 A records and ping each resolved IP address individually by default.

gping supports specifying multiple IP addresses/hosts as targets, allowing several endpoints to be monitored simultaneously. gping uses Rust's ToSocketAddrs to resolve a hostname.
It does retrieve all addresses returned by the resolver into ipaddr.
But then it explicitly selects only one address:
-4: first IPv4 address
-6: first IPv6 address
otherwise: the first address returned. The function ultimately returns a single String IP address

However, when a DNS name resolves to multiple A records, the DNS name is currently treated as a single target rather than automatically monitoring all of the IP addresses returned by DNS.

Requested Behaviour

When a user supplies a DNS hostname, gping should:

Perform a DNS lookup for the hostname.
Retrieve all IPv4/6 A records associated with the hostname.
Create a ping target for each unique IP address returned.
Display and monitor each IP address independently.

For example:

gping example.com

If example.com resolves to:

192.0.2.10
192.0.2.11
192.0.2.12

gping should effectively monitor all three addresses simultaneously, rather than only monitoring a single resolved address.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Rust ToSocketAddrs resolution path described in the issue and trace where the resolver's addresses are reduced to one String target. Implement the target expansion so each unique resolved address is monitored independently, then verify that a hostname resolving to multiple IPv4 addresses displays and pings every address.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.