DnsResolver.cpp

1. Overview

Reverse DNS implementation. Uses getaddrinfo/getnameinfo-compatible socket APIs to translate IPv4 or IPv6 addresses into hostnames without making the lookup fatal to connection processing.

The original source path is:

src/net/DnsResolver.cpp

2. Role in the Daemon

This file participates in the privileged BastionGuard Secure Connection daemon. It uses the shared bsc models and follows the daemon-wide fallback strategy: optional high-fidelity backends are used when available, while portable polling or stub behavior preserves service startup.


3. Namespaces

  • bsc::net

4. Dependencies and Included Interfaces

  • bsc/net/DnsResolver.hpp
  • arpa/inet.h
  • netdb.h
  • string.h

5. API and Functions

The file declares or implements the following callable entry points:

  • DnsResolver::reverse_lookup(const std::string& ip)

6. External Resources and Protocol Values

Relevant paths, endpoints, command names or policy values referenced by this file include:

  • bsc/net/DnsResolver.hpp

7. Implementation Considerations

  • The file follows the daemon-wide convention of returning status values or optional objects instead of making recoverable conditions fatal.

8. Source Metrics

MetricValue
File size800 bytes
Lines24
Detected API entries1
Detected types0