我完全迷失在這裏。我試圖根據文檔https://whoisrb.org/設置whois gem。不幸的是,當我嘗試在我的機器上本地執行whois時,我總是遇到錯誤。whois-rb gem產生錯誤:「Whois :: ServerNotFound」
錯誤消息:
Unable to find a WHOIS server for `;; answer received from 192.168.178.1 (75 bytes) ;; ;; security level : unchecked ;; ->>header<<- opcode: query, status: noerror, id: 51102 ;; flags: qr rd ra cd; query: 1, answer: 1, authority: 0, additional: 1 opt pseudo-record : payloadsize 512, xrcode 0, version 0, flags 32768 ;; question section (1 record) ;; google-public-dns-b.google.com. in a ;; answer section (1 record) google-public-dns-b.google.com. 84453 in a 8.8.4.4 '
不要誤會,我使用的dnsruby寶石以及..在我的模型對應的代碼:
def set_isp res = Resolver.new a_record = res.query(self.domain_name) whois = Whois::Client.new rec = whois.lookup(a_record) self.isp = rec.name end
非常感謝提前!