Skip to content

v1.4.0: Feature/Ability to use internationalized hostnames

Compare
Choose a tag to compare
@bestwebua bestwebua released this 13 Jul 16:13
· 119 commits to master since this release
cd2b9d3

Added ability to use internationalized hostnames. All hostnames in UTF-8 will be represented as Punycode.

DnsMock.start_server(port: 5300, records: { 'mañana.com' => { mx: %w[másletras.mañana.com] })
dig @localhost -p 5300 MX xn--maana-pta.com
; <<>> DiG 9.10.6 <<>> @localhost -p 5300 MX xn--maana-pta.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4612
;; flags: rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;xn--maana-pta.com.		IN	MX

;; ANSWER SECTION:
xn--maana-pta.com.	1	IN	MX	10 xn--msletras-8ya.xn--maana-pta.com.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#5300(127.0.0.1)
;; WHEN: Tue Jul 13 15:38:47 EEST 2021
;; MSG SIZE  rcvd: 79
  1. Added simpleidn as runtime dependency
  2. Implemented DnsMock::Representer::Punycode, tests
  3. Refactored DnsMock::Representer::RdnsLookup, tests
  4. Updated DnsMock::Record::Factory::Base
  5. Updated DnsMock::Server::RecordsDictionaryBuilder, tests
  6. Updated DnsMock::Record::Factory::Cname, tests
  7. Updated DnsMock::Record::Factory::Mx, tests
  8. Updated DnsMock::Record::Factory::Ns, tests
  9. Updated DnsMock::Record::Factory::Ptr, tests
  10. Updated DnsMock::Record::Factory::Soa, tests
  11. Updated DnsMock::ContextGeneratorHelper, tests
  12. Updated reek config
  13. Updated gem documentation
  14. Updated gem version to 1.4.0