Paste Search Dynamic
Recent pastes
lookup(domain)
  1. function lookup(domain) {
  2.     /*
  3.  
  4. Cloudflare DNSSEC have been added, which makes the RCODE run out of space to express the server's internal status. To keep backward compatibility, DNS servers have to squeeze various statuses into existing ones.
  5. */
  6.     switch result {
  7.     case "No error condition":
  8.         return NOERROR with client expected answer
  9.     case "No record for the request type":
  10.         return NOERROR
  11.     case "The request domain does not exist":
  12.         return NXDOMAIN
  13.     case "Refuse to perform the specified operation for policy reasons":
  14.         return REFUSE
  15.     default("Server failure: unable to process this query due to a problem with the name server"):
  16.         return SERVFAIL
  17.     }
  18. }
  19.  
  20. try {
  21.     lookup(domain)
  22. } catch {
  23.     return SERVFAIL
  24. }
Parsed in 0.002 seconds