#include #include #include #include #include "sclasses.hh" #include #include #include "record-types.hh" /*! @file @brief Tiny 'dig'-like utility to create DNS queries & print responses */ using namespace std; //! This function is plain wrong and does unescape its input DNSName makeDNSName(const std::string& str) { DNSName ret; string part; for(const auto& c: str) { if(c=='.') { ret.push_back(part); part.clear(); } else part.append(1, c); } if(!part.empty()) ret.push_back(part); return ret; } int main(int argc, char** argv) try { if(argc != 4) { cerr<<"Syntax: tdig name type ip[:port]"< rr; while(dmr.getRR(rrsection, dn, dt, ttl, rr)) { cout << dn<< " IN " << dt << " " << ttl << " " <toString()<