{"action":"created","issue":{"url":"https://api.github.com/repos/hjr265/node-whois/issues/26","repository_url":"https://api.github.com/repos/hjr265/node-whois","labels_url":"https://api.github.com/repos/hjr265/node-whois/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/hjr265/node-whois/issues/26/comments","events_url":"https://api.github.com/repos/hjr265/node-whois/issues/26/events","html_url":"https://github.com/hjr265/node-whois/issues/26","id":150979030,"number":26,"title":"Incorrect results for IDN .de domains","user":{"login":"frdmn","id":944459,"avatar_url":"https://avatars.githubusercontent.com/u/944459?v=3","gravatar_id":"","url":"https://api.github.com/users/frdmn","html_url":"https://github.com/frdmn","followers_url":"https://api.github.com/users/frdmn/followers","following_url":"https://api.github.com/users/frdmn/following{/other_user}","gists_url":"https://api.github.com/users/frdmn/gists{/gist_id}","starred_url":"https://api.github.com/users/frdmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frdmn/subscriptions","organizations_url":"https://api.github.com/users/frdmn/orgs","repos_url":"https://api.github.com/users/frdmn/repos","events_url":"https://api.github.com/users/frdmn/events{/privacy}","received_events_url":"https://api.github.com/users/frdmn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-25T20:58:27Z","updated_at":"2016-04-27T03:23:51Z","closed_at":null,"body":"When looking up an IDN .de domain, node-whois is trying to convert it into punyname before sending the actual whois request:\r\n\r\n```js\r\n\"data\": \"Domain: xn--kche-0ra.de\\nStatus: invalid\\n\",\r\n\"server\": {\r\n    \"host\": \"whois.denic.de\",\r\n    \"port\": 43,\r\n    \"query\": \"$addr\\r\\n\"\r\n}\r\n```\r\n\r\nDENIC's whois server (`whois.denic.de`) however expects the domain in the normal unicode format:\r\n\r\n```js\r\n\"data\": \"Domain: küche.de\\nDomain-Ace: xn--kche-0ra.de\\nStatus: connect\\n\",\r\n\"server\": {\r\n    \"host\": \"whois.denic.de\",\r\n    \"port\": 43,\r\n    \"query\": \"$addr\\r\\n\"\r\n}\r\n```\r\n\r\nFor the result above I changed the following code:\r\n\r\n```diff\r\n-      return socket.write(server.query.replace('$addr', punycode.toASCII(addr)));\r\n+      return socket.write(server.query.replace('$addr', addr));\r\n```\r\n\r\nI have no clue if this is a special case or if it's the general way to lookup IDN domains in whois servers. Can anyone shed some light in here?"},"comment":{"url":"https://api.github.com/repos/hjr265/node-whois/issues/comments/214959886","html_url":"https://github.com/hjr265/node-whois/issues/26#issuecomment-214959886","issue_url":"https://api.github.com/repos/hjr265/node-whois/issues/26","id":214959886,"user":{"login":"hjr265","id":348107,"avatar_url":"https://avatars.githubusercontent.com/u/348107?v=3","gravatar_id":"","url":"https://api.github.com/users/hjr265","html_url":"https://github.com/hjr265","followers_url":"https://api.github.com/users/hjr265/followers","following_url":"https://api.github.com/users/hjr265/following{/other_user}","gists_url":"https://api.github.com/users/hjr265/gists{/gist_id}","starred_url":"https://api.github.com/users/hjr265/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjr265/subscriptions","organizations_url":"https://api.github.com/users/hjr265/orgs","repos_url":"https://api.github.com/users/hjr265/repos","events_url":"https://api.github.com/users/hjr265/events{/privacy}","received_events_url":"https://api.github.com/users/hjr265/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T03:23:51Z","updated_at":"2016-04-27T03:23:51Z","body":"Hi @frdmn .. I think we may need to selectively disable the use of punycode for some of these WHOIS servers. And then add an option to skip punycode conversation during invocation. Apparently some servers can handle unicode now."}}