Subject: acountry and the .eu TLD

acountry and the .eu TLD

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Thu, 21 Jul 2011 20:31:11 +0200

Something has changed at the DNSBL at countries.nerd.dk.
acountry.c uses this service to translate IPv4-addresses into
county info.

Trying something like:

>acountry -vvv ecatel-ic-139206-adm-b5.c.telia.net
host ecatel-ic-139206-adm-b5.c.telia.net has address 213.248.101.90.
Looking up 90.101.248.213.zz.countries.nerd.dk...
Found address 127.0.255.1, name 90.101.248.213.zz.countries.nerd.dk
Found country-code `<n/a>', number 65281
Name for country-number 65281 not found.

Checking the CNAME further with adig, gets me this:

>adig.exe -t txt 90.101.248.213.zz.countries.nerd.dk
id: 42098
flags: qr rd ra
opcode: QUERY
rcode: NOERROR
Questions:
        90.101.248.213.zz.countries.nerd.dk. TXT
Answers:
        90.101.248.213.zz.countries.nerd.dk. 2100 TXT eu
NS records:
        countries.nerd.dk. 8422 NS countries-ns.mdc.dk.
        countries.nerd.dk. 8422 NS countries.pil.dk.
        countries.nerd.dk. 8422 NS michelin.bananas.dk.
Additional records:
        michelin.bananas.dk. 49915 A 194.255.237.134
        countries.pil.dk. 6900 A 78.46.112.230
        countries-ns.mdc.dk. 510 A 193.189.92.58

-----------------------------------

Looks like now they have defined the European Union as a country!
Wadda a joke :-) So, I suggest some easy patch to fix this:

--- Git-latest\acountry.c Wed Jul 20 21:51:20 2011
+++ .\acountry.c Thu Jul 21 20:05:43 2011
@@ -165,6 +165,9 @@
         {
           ares_gethostbyname(channel, *argv, AF_INET, callback2, &addr);
           wait_ares(channel);
+ TRACE(("host %s has address %s\n", *argv,
+ ares_inet_ntop(AF_INET,(const char*)&addr,buf,sizeof(buf))));
+
           if (addr.s_addr == INADDR_NONE)
             {
               printf("Failed to lookup %s\n", *argv);
@@ -350,6 +353,7 @@
        { 232, "er", "Eritrea" },
        { 233, "ee", "Estonia" },
        { 231, "et", "Ethiopia" },
+ { 65281, "eu", "European Union" }, /* 127.0.255.1 */
        { 238, "fk", "Falkland Islands" },
        { 234, "fo", "Faroe Islands" },
        { 242, "fj", "Fiji" },

------------------

How about it? Should EU be a "country"?

PS. The extra TRACE is just for convenience if we give acountry a host-name
that must be resolved first.

PS2. The service http://whatismyipaddress.com/ip/213.248.101.90
claims the host is in Germany. So I'm not sure who to trust.

--gv
Received on 2011-07-21