# 514-labs/dnsglobe architecture

> Architecture diagram of the GitHub repository 514-labs/dnsglobe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/514-labs/dnsglobe
- Repository: https://github.com/514-labs/dnsglobe

## Overview

dnsglobe is a terminal DNS propagation checker. The user enters a domain and record type, then the app queries configured public or custom resolvers (optionally with ECS), compares answers and cache state, and presents results in a live table and map/globe. Watch mode repeats checks; one-shot mode prints results. The graph preserves resolver-site discovery and customization capabilities documented in the README. Relationships follow the shown startup and dispatch code, source-index references, and README; some implementation details are excerpted only partially.

Main entry points: [`src/main.rs`](https://github.com/514-labs/dnsglobe/blob/main/src/main.rs) (CLI and event loop), [`src/ui.rs`](https://github.com/514-labs/dnsglobe/blob/main/src/ui.rs) (TUI results and map), [`src/app.rs`](https://github.com/514-labs/dnsglobe/blob/main/src/app.rs) (Query state and comparison), [`src/config.rs`](https://github.com/514-labs/dnsglobe/blob/main/src/config.rs) (Settings loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and interaction"]
  node_main["CLI and event loop<br/>[main.rs]"]
  node_app["Query state and comparison<br/>[app.rs]"]
  node_config["Settings loader<br/>[config.rs]"]
end

subgraph group_query["DNS query and analysis"]
  node_dns["DNS querying and ECS<br/>[dns.rs]"]
end

subgraph group_network["Resolver and site data"]
  node_resolverlist["Resolver catalog<br/>[resolvers.rs]"]
  node_sites["Anycast site discovery<br/>[sites.rs]"]
end

subgraph group_presentation["Terminal presentation"]
  node_ui["TUI results and map<br/>[ui.rs]"]
  node_globe["Map/globe projection<br/>[globe.rs]"]
  node_worlddata["Coastline data<br/>[world_data.rs]"]
  node_theme["Theme roles<br/>[theme.rs]"]
end

node_user(("Terminal user"))
node_dnsservers(("DNS resolver endpoints"))

node_user -->|"starts and controls"| node_main
node_main -->|"loads settings"| node_config
node_main -->|"initializes resolvers"| node_resolverlist
node_main -->|"initializes theme"| node_theme
node_main -->|"dispatches queries"| node_app
node_main -->|"starts site probes"| node_sites
node_main -->|"draws interface"| node_ui
node_config -->|"extends or replaces"| node_resolverlist
node_config -->|"parses ECS"| node_dns
node_config -->|"configures colors"| node_theme
node_app -->|"queries records"| node_dns
node_dns -->|"sends DNS queries"| node_dnsservers
node_main -.->|"probes endpoints"| node_dnsservers
node_resolverlist -->|"selects probe type"| node_sites
node_sites -->|"runs identification queries"| node_dns
node_app -->|"uses resolver set"| node_resolverlist
node_app -->|"provides result state"| node_ui
node_ui -->|"projects world view"| node_globe
node_ui -->|"draws coastlines"| node_worlddata
node_ui -->|"styles display"| node_theme

click node_main "https://github.com/514-labs/dnsglobe/blob/main/src/main.rs"
click node_app "https://github.com/514-labs/dnsglobe/blob/main/src/app.rs"
click node_config "https://github.com/514-labs/dnsglobe/blob/main/src/config.rs"
click node_dns "https://github.com/514-labs/dnsglobe/blob/main/src/dns.rs"
click node_resolverlist "https://github.com/514-labs/dnsglobe/blob/main/src/resolvers.rs"
click node_sites "https://github.com/514-labs/dnsglobe/blob/main/src/sites.rs"
click node_ui "https://github.com/514-labs/dnsglobe/blob/main/src/ui.rs"
click node_globe "https://github.com/514-labs/dnsglobe/blob/main/src/globe.rs"
click node_worlddata "https://github.com/514-labs/dnsglobe/blob/main/src/world_data.rs"
click node_theme "https://github.com/514-labs/dnsglobe/blob/main/src/theme.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_config,node_user toneBlue
class node_dns toneAmber
class node_resolverlist,node_sites toneMint
class node_ui,node_globe,node_worlddata,node_theme toneRose
class node_dnsservers toneIndigo
```

## Components

### Runtime and interaction

- [CLI and event loop](https://github.com/514-labs/dnsglobe/blob/main/src/main.rs): `src/main.rs`
- [Query state and comparison](https://github.com/514-labs/dnsglobe/blob/main/src/app.rs): `src/app.rs`
- [Settings loader](https://github.com/514-labs/dnsglobe/blob/main/src/config.rs): `src/config.rs`

### DNS query and analysis

- [DNS querying and ECS](https://github.com/514-labs/dnsglobe/blob/main/src/dns.rs): `src/dns.rs`

### Resolver and site data

- [Resolver catalog](https://github.com/514-labs/dnsglobe/blob/main/src/resolvers.rs): `src/resolvers.rs`
- [Anycast site discovery](https://github.com/514-labs/dnsglobe/blob/main/src/sites.rs): `src/sites.rs`

### Terminal presentation

- [TUI results and map](https://github.com/514-labs/dnsglobe/blob/main/src/ui.rs): `src/ui.rs`
- [Map/globe projection](https://github.com/514-labs/dnsglobe/blob/main/src/globe.rs): `src/globe.rs`
- [Coastline data](https://github.com/514-labs/dnsglobe/blob/main/src/world_data.rs): `src/world_data.rs`
- [Theme roles](https://github.com/514-labs/dnsglobe/blob/main/src/theme.rs): `src/theme.rs`

### Other components

- **Terminal user**
- **DNS resolver endpoints**

## Connections

- Terminal user → CLI and event loop: starts and controls (evidence: `README.md`)
- CLI and event loop → Settings loader: loads settings (evidence: `src/main.rs`)
- CLI and event loop → Resolver catalog: initializes resolvers (evidence: `src/main.rs`)
- CLI and event loop → Theme roles: initializes theme (evidence: `src/main.rs`)
- CLI and event loop → Query state and comparison: dispatches queries (evidence: `src/main.rs`)
- CLI and event loop → Anycast site discovery: starts site probes (evidence: `src/main.rs`)
- CLI and event loop → TUI results and map: draws interface (evidence: `src/main.rs`)
- Settings loader → Resolver catalog: extends or replaces (evidence: `src/config.rs`)
- Settings loader → DNS querying and ECS: parses ECS (evidence: `src/config.rs`)
- Settings loader → Theme roles: configures colors (evidence: `src/config.rs`)
- Query state and comparison → DNS querying and ECS: queries records (evidence: `src/app.rs`)
- DNS querying and ECS → DNS resolver endpoints: sends DNS queries (evidence: `src/dns.rs`)
- CLI and event loop → DNS resolver endpoints: probes endpoints
- Resolver catalog → Anycast site discovery: selects probe type (evidence: `src/resolvers.rs`)
- Anycast site discovery → DNS querying and ECS: runs identification queries (evidence: `src/sites.rs`)
- Query state and comparison → Resolver catalog: uses resolver set (evidence: `src/app.rs`)
- Query state and comparison → TUI results and map: provides result state (evidence: `src/ui.rs`)
- TUI results and map → Map/globe projection: projects world view (evidence: `src/ui.rs`)
- TUI results and map → Coastline data: draws coastlines (evidence: `src/ui.rs`)
- TUI results and map → Theme roles: styles display (evidence: `src/ui.rs`)
