         return res
     }
     
+    public func cleanCache() {
+        self.cache.removeAll()
+    }
+    
     func getRequestString(domain: String) -> String {
         return self.SERVER_ADDRESS + "d?dn=" + domain + "&ttl=1"
     }

    func requsetRecordSync(domain: String) -> DNSRecord! {
        let urlString = getRequestString(domain)
        guard let url = NSURL(string: urlString) else {
            print("Error: cannot create URL")
            return nil
        }
        guard let data = NSData.init(contentsOfURL: url) else {
            print("did not receive data")
            return nil
        }
        guard let res = self.parseResult(data) else {
            print("Error: parseResult error")
            return nil
        }
        self.cache.updateValue(res, forKey: domain)

    var cache = Dictionary<String,DNSRecord>()
    
    public static let sharedInstance = HTTPDNS()
    
    private init() {}
    
    public func getRecord(domain: String, callback: (result:DNSRecord!) -> Void) {
        let res = self.cache[domain]
