How to Use the Command 'doggo' (with Examples)

How to Use the Command 'doggo' (with Examples)

doggo is a DNS client tool crafted for humans, simplifying the process of executing DNS queries. Built with Golang, it offers a user-friendly interface to perform DNS lookups without delving into the complexities often associated with DNS query tools. Whether you’re a network administrator, developer, or just someone curious about DNS, doggo provides an intuitive way to get DNS information quickly.

Perform a Simple DNS Lookup (with Examples)

Code:

doggo example.com

Motivation:

Performing a simple DNS lookup is one of the most common tasks when dealing with domain names. By using doggo, you can effortlessly resolve a domain like example.com to its corresponding IP address without needing to remember complex commands or installations.

Explanation:

  • doggo: This initiates the command using the doggo tool.
  • example.com: The domain you want to perform the lookup for. This argument specifies the target of your DNS query and returns the IP address associated with the domain.

Example Output:

A 93.184.216.34

The output indicates that the domain example.com resolves to the IP address 93.184.216.34.

Query MX Records Using a Specific Nameserver (with Examples)

Code:

doggo MX codeberg.org @1.1.1.2

Motivation:

Mail Exchange (MX) records determine the mail server responsible for receiving email messages on behalf of a domain. If you’re troubleshooting email delivery issues or configuring mail servers, querying the MX records can provide crucial insights. By specifying a particular nameserver, you can also verify the MX records as seen from different points on the internet.

Explanation:

  • doggo: Launches the DNS query command using doggo.
  • MX: Requests the MX record type, which pertains to mail servers.
  • codeberg.org: The domain for which you are querying the MX records.
  • @1.1.1.2: This queries a specific DNS nameserver (in this case, Cloudflare’s secondary DNS server) which may have different propagation times for record updates.

Example Output:

MX 10 mail.codeberg.org

The output shows that the Mail Exchange preference for codeberg.org is directed to the server mail.codeberg.org with a priority of 10.

Use DNS Over HTTPS (with Examples)

Code:

doggo example.com @https://dns.quad9.net/dns-query

Motivation:

DNS over HTTPS (DoH) adds a layer of privacy and security by encrypting DNS queries, thus preventing ISP-level tracking and man-in-the-middle attacks. This is particularly beneficial when operating on untrusted networks or regions with stringent privacy issues.

Explanation:

  • doggo: Executes the command using the doggo tool.
  • example.com: The domain to look up using DNS over HTTPS.
  • @https://dns.quad9.net/dns-query: Specifies the DNS server’s DoH URL, allowing encrypted DNS queries to improve security and privacy during the DNS resolution process.

Example Output:

A 93.184.216.34

Similar to a normal DNS resolution, the output returns the IP address 93.184.216.34 but adds the enhanced security layer via HTTPS.

Output in the JSON Format (with Examples)

Code:

doggo example.com --json | jq '.responses[0].answers[].address'

Motivation:

Outputting in JSON is useful for automation, data processing, and integration with other tools or scripts. This structured data format makes it easy to extract specific data fields programmatically, aiding in systems that favor JSON input or analysis.

Explanation:

  • doggo: Start the command with the doggo tool.
  • example.com: Domain to perform DNS lookup on.
  • --json: Outputs the response in JSON format for easy parsing and manipulation.
  • | jq '.responses[0].answers[].address': A command-line JSON processor (jq) that extracts and filters out only the address field from the JSON output.

Example Output:

"93.184.216.34"

The filtered JSON response clearly outputs the IP, which aids in detailed data analysis or API integrations.

Perform a Reverse DNS Lookup (with Examples)

Code:

doggo --reverse 8.8.4.4 --short

Motivation:

Reverse DNS lookup is the inverse of a DNS lookup: starting with an IP address to find its associated domain name. This can be helpful for network diagnostics or determining domain names used by specific IPs, which can be crucial for network planning or troubleshooting.

Explanation:

  • doggo: Utilize the doggo tool for DNS querying.
  • --reverse: Indicates a reverse DNS lookup, starting with an IP.
  • 8.8.4.4: The target IP address, in this instance, Google’s Public DNS.
  • --short: Provides a condensed output, simplifying the result.

Example Output:

google-public-dns-b.google.com.

The response informs the reader that the IP 8.8.4.4 resolves back to the domain google-public-dns-b.google.com.

Conclusion

doggo proves to be a versatile and user-friendly utility for handling DNS queries. From simple domain resolutions to more advanced queries over HTTPS and structured JSON outputs, doggo simplifies DNS interactions with straightforward commands and clear outputs. As DNS remains a foundational internet service, tools like doggo equip users to better understand and manage their network queries effectively.

Related Posts

Exploring the 'virsh help' Command (with examples)

Exploring the 'virsh help' Command (with examples)

The virsh command is a powerful utility tool used in virtualized environments to manage guest virtual machines and interact with the underlying hypervisor.

Read More
How to Use the Command 'cpdf' (with Examples)

How to Use the Command 'cpdf' (with Examples)

cpdf is a powerful command-line tool for manipulating PDF files in various ways.

Read More
How to use the command 'systemd-id128' (with examples)

How to use the command 'systemd-id128' (with examples)

The systemd-id128 command-line tool is an essential utility within the systemd ecosystem for generating and retrieving unique 128-bit identifiers (IDs).

Read More