Skip to content

Commit

Permalink
Improve JSON output keys name
Browse files Browse the repository at this point in the history
  • Loading branch information
Themimitoof committed Aug 17, 2022
1 parent 7355987 commit 1a5a674
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ func GenerateDNSRecord(ip string, ttl int, hostname string) string {
hostname += "."
}

return fmt.Sprintf("%s\t%d\tIN\tAAAA\t%s", hostname, ttl, ip)
return fmt.Sprintf("%s %d IN AAAA %s", hostname, ttl, ip)
}

// Generate a ARPA record ready to be paste on a Bind compatible zone
func GenerateReverseDNSRecord(ip string, ttl int, hostname string) string {
return fmt.Sprintf("%s.\t%d\tIN\tPTR\t%s", ip, ttl, hostname)
return fmt.Sprintf("%s. %d IN PTR %s", ip, ttl, hostname)
}
10 changes: 5 additions & 5 deletions src/output/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type OutputInformationSettings struct {
}

type IpgOutputData struct {
Hostname string
IPAddress string
IPReverse string
DNSRecord string
ReverseRecord string
Hostname string `json:"hostname"`
IPAddress string `json:"ip_addr"`
IPReverse string `json:"arpa_addr"`
DNSRecord string `json:"dns_record"`
ReverseRecord string `json:"ptr_record"`
}

0 comments on commit 1a5a674

Please sign in to comment.