From: Tom Hughes Date: Mon, 15 Dec 2014 14:32:55 +0000 (+0000) Subject: Switch to using gdnsd for geodns X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/6f6ac0de26339fe17da0594649ce1b1dfe2c7f80 Switch to using gdnsd for geodns --- diff --git a/cookbooks/geodns/recipes/default.rb b/cookbooks/geodns/recipes/default.rb index 09f28c9d9..8a72c17a2 100644 --- a/cookbooks/geodns/recipes/default.rb +++ b/cookbooks/geodns/recipes/default.rb @@ -17,53 +17,67 @@ # limitations under the License. # -package "pdns-server" -package "pdns-backend-geo" - service "pdns" do - action [ :enable, :start ] + action [ :stop, :disable ] supports :status => true, :restart => true, :reload => true end +file "/etc/powerdns/countries.conf" do + action :delete +end + file "/etc/powerdns/pdns.d/pdns.simplebind" do action :delete notifies :reload, "service[pdns]" end -template "/etc/powerdns/pdns.d/geo.conf" do - source "geo.conf.erb" - owner "root" - group "root" - mode "0600" - notifies :reload, "service[pdns]" +file "/etc/powerdns/pdns.d/geo.conf" do + action :delete +end + +file "/etc/powerdns/zones.d/tile.conf" do + action :delete end directory "/etc/powerdns/zones.d" do - owner "root" - group "root" - mode "0755" + action :delete end -template "/etc/powerdns/zones.d/tile.conf" do - source "tile.conf.erb" - owner "root" - group "root" - mode "0644" - notifies :reload, "service[pdns]" +file "/etc/cron.weekly/geodns-update" do + action :delete +end + +package "pdns-backend-geo" do + action :purge +end + +package "pdns-server" do + action :purge end -template "/etc/cron.weekly/geodns-update" do - source "cron.erb" +package "geoip-database-contrib" + +package "gdnsd" + +service "gdnsd" do + action [ :enable, :start ] + supports :status => true, :restart => true, :reload => true +end + +template "/etc/gdnsd/config" do + source "config.erb" owner "root" group "root" - mode "0755" + mode 0644 + notifies :restart, "service[gdnsd]" end -execute "geodns-sync-countries" do - command "rsync -z rsync://countries-ns.mdc.dk/zone/zz.countries.nerd.dk.rbldnsd /etc/powerdns/countries.conf" - user "root" +template "/etc/gdnsd/zones/geo.openstreetmap.org" do + source "geo.erb" + owner "root" group "root" - not_if { File.exist?("/etc/powerdns/countries.conf") } + mode 0644 + notifies :restart, "service[gdnsd]" end firewall_rule "accept-dns-udp" do diff --git a/cookbooks/geodns/templates/default/config.erb b/cookbooks/geodns/templates/default/config.erb new file mode 100644 index 000000000..87539febf --- /dev/null +++ b/cookbooks/geodns/templates/default/config.erb @@ -0,0 +1,531 @@ +plugins => { + geoip => { + maps => { + country => { + geoip_db => /usr/share/GeoIP/GeoIPv6.dat + datacenters => [ad,ae,af,ag,ai,al,am,ao,aq,ar,as,at,au,aw,ax,az,ba,bb,bd,be,bf,bg,bh,bi,bj,bl,bm,bn,bo,bq,br,bs,bt,bv,bw,by,bz,ca,cc,cd,cf,cg,ch,ci,ck,cl,cm,cn,co,cr,cu,cv,cw,cx,cy,cz,de,dj,dk,dm,do,dz,ec,ee,eg,eh,er,es,et,fi,fj,fk,fm,fo,fr,ga,gb,gd,ge,gf,gg,gh,gi,gl,gm,gn,gp,gq,gr,gs,gt,gu,gw,gy,hk,hm,hn,hr,ht,hu,id,ie,il,im,in,io,iq,ir,is,it,je,jm,jo,jp,ke,kg,kh,ki,km,kn,kp,kr,kw,ky,kz,la,lb,lc,li,lk,lr,ls,lt,lu,lv,ly,ma,mc,md,me,mf,mg,mh,mk,ml,mm,mn,mo,mp,mq,mr,ms,mt,mu,mv,mw,mx,my,mz,na,nc,ne,nf,ng,ni,nl,no,np,nr,nu,nz,om,pa,pe,pf,pg,ph,pk,pl,pm,pn,pr,ps,pt,pw,py,qa,re,ro,rs,ru,rw,sa,sb,sc,sd,se,sg,sh,si,sj,sk,sl,sm,sn,so,sr,st,sv,sx,sy,sz,tc,td,tf,tg,th,tj,tk,tl,tm,tn,to,tr,tt,tv,tw,tz,ua,ug,um,us,uy,uz,va,vc,ve,vg,vi,vn,vu,wf,ws,xx,ye,yt,za,zm,zw] + map => { + default => [xx] + AF => { + AO => [ao] + BF => [bf] + BI => [bi] + BJ => [bj] + BW => [bw] + CD => [cd] + CF => [cf] + CG => [cg] + CI => [ci] + CM => [cm] + CV => [cv] + DJ => [dj] + DZ => [dz] + EG => [eg] + EH => [eh] + ER => [er] + ET => [et] + GA => [ga] + GH => [gh] + GM => [gm] + GN => [gn] + GQ => [gq] + GW => [gw] + KE => [ke] + KM => [km] + LR => [lr] + LS => [ls] + LY => [ly] + MA => [ma] + MG => [mg] + ML => [ml] + MR => [mr] + MU => [mu] + MW => [mw] + MZ => [mz] + NA => [na] + NE => [ne] + NG => [ng] + RE => [re] + RW => [rw] + SC => [sc] + SD => [sd] + SH => [sh] + SL => [sl] + SN => [sn] + SO => [so] + ST => [st] + SZ => [sz] + TD => [td] + TG => [tg] + TN => [tn] + TZ => [tz] + UG => [ug] + YT => [yt] + ZA => [za] + ZM => [zm] + ZW => [zw] + } + AN => { + AQ => [aq] + BV => [bv] + GS => [gs] + HM => [hm] + TF => [tf] + } + AS => { + AE => [ae] + AF => [af] + AM => [am] + AZ => [az] + BD => [bd] + BH => [bh] + BN => [bn] + BT => [bt] + CC => [cc] + CN => [cn] + CX => [cx] + GE => [ge] + HK => [hk] + ID => [id] + IL => [il] + IN => [in] + IO => [io] + IQ => [iq] + IR => [ir] + JO => [jo] + JP => [jp] + KG => [kg] + KH => [kh] + KP => [kp] + KR => [kr] + KW => [kw] + KZ => [kz] + LA => [la] + LB => [lb] + LK => [lk] + MM => [mm] + MN => [mn] + MO => [mo] + MV => [mv] + MY => [my] + NP => [np] + OM => [om] + PH => [ph] + PK => [pk] + PS => [ps] + QA => [qa] + SA => [sa] + SG => [sg] + SY => [sy] + TH => [th] + TJ => [tj] + TM => [tm] + TR => [tr] + TW => [tw] + UZ => [uz] + VN => [vn] + YE => [ye] + } + EU => { + AD => [ad] + AL => [al] + AT => [at] + AX => [ax] + BA => [ba] + BE => [be] + BG => [bg] + BY => [by] + CH => [ch] + CY => [cy] + CZ => [cz] + DE => [de] + DK => [dk] + EE => [ee] + ES => [es] + FI => [fi] + FO => [fo] + FR => [fr] + GB => [gb] + GG => [gg] + GI => [gi] + GR => [gr] + HR => [hr] + HU => [hu] + IE => [ie] + IM => [im] + IS => [is] + IT => [it] + JE => [je] + LI => [li] + LT => [lt] + LU => [lu] + LV => [lv] + MC => [mc] + MD => [md] + ME => [me] + MK => [mk] + MT => [mt] + NL => [nl] + NO => [no] + PL => [pl] + PT => [pt] + RO => [ro] + RS => [rs] + RU => [ru] + SE => [se] + SI => [si] + SJ => [sj] + SK => [sk] + SM => [sm] + UA => [ua] + VA => [va] + } + NA => { + AG => [ag] + AI => [ai] + AW => [aw] + BB => [bb] + BL => [bl] + BM => [bm] + BQ => [bq] + BS => [bs] + BZ => [bz] + CA => [ca] + CR => [cr] + CU => [cu] + CW => [cw] + DM => [dm] + DO => [do] + GD => [gd] + GL => [gl] + GP => [gp] + GT => [gt] + HN => [hn] + HT => [ht] + JM => [jm] + KN => [kn] + KY => [ky] + LC => [lc] + MF => [mf] + MQ => [mq] + MS => [ms] + MX => [mx] + NI => [ni] + PA => [pa] + PM => [pm] + PR => [pr] + SV => [sv] + SX => [sx] + TC => [tc] + TT => [tt] + US => [us] + VC => [vc] + VG => [vg] + VI => [vi] + } + OC => { + AS => [as] + AU => [au] + CK => [ck] + FJ => [fj] + FM => [fm] + GU => [gu] + KI => [ki] + MH => [mh] + MP => [mp] + NC => [nc] + NF => [nf] + NR => [nr] + NU => [nu] + NZ => [nz] + PF => [pf] + PG => [pg] + PN => [pn] + PW => [pw] + SB => [sb] + TK => [tk] + TL => [tl] + TO => [to] + TV => [tv] + UM => [um] + VU => [vu] + WF => [wf] + WS => [ws] + } + SA => { + AR => [ar] + BO => [bo] + BR => [br] + CL => [cl] + CO => [co] + EC => [ec] + FK => [fk] + GF => [gf] + GY => [gy] + PE => [pe] + PY => [py] + SR => [sr] + UY => [uy] + VE => [ve] + } + } + } + } + resources => { + tile => { + map => country + dcmap => { + ad => ad.tile.openstreetmap.org. + ae => ae.tile.openstreetmap.org. + af => af.tile.openstreetmap.org. + ag => ag.tile.openstreetmap.org. + ai => ai.tile.openstreetmap.org. + al => al.tile.openstreetmap.org. + am => am.tile.openstreetmap.org. + ao => ao.tile.openstreetmap.org. + aq => aq.tile.openstreetmap.org. + ar => ar.tile.openstreetmap.org. + as => as.tile.openstreetmap.org. + at => at.tile.openstreetmap.org. + au => au.tile.openstreetmap.org. + aw => aw.tile.openstreetmap.org. + ax => ax.tile.openstreetmap.org. + az => az.tile.openstreetmap.org. + ba => ba.tile.openstreetmap.org. + bb => bb.tile.openstreetmap.org. + bd => bd.tile.openstreetmap.org. + be => be.tile.openstreetmap.org. + bf => bf.tile.openstreetmap.org. + bg => bg.tile.openstreetmap.org. + bh => bh.tile.openstreetmap.org. + bi => bi.tile.openstreetmap.org. + bj => bj.tile.openstreetmap.org. + bl => bl.tile.openstreetmap.org. + bm => bm.tile.openstreetmap.org. + bn => bn.tile.openstreetmap.org. + bo => bo.tile.openstreetmap.org. + bq => bq.tile.openstreetmap.org. + br => br.tile.openstreetmap.org. + bs => bs.tile.openstreetmap.org. + bt => bt.tile.openstreetmap.org. + bv => bv.tile.openstreetmap.org. + bw => bw.tile.openstreetmap.org. + by => by.tile.openstreetmap.org. + bz => bz.tile.openstreetmap.org. + ca => ca.tile.openstreetmap.org. + cc => cc.tile.openstreetmap.org. + cd => cd.tile.openstreetmap.org. + cf => cf.tile.openstreetmap.org. + cg => cg.tile.openstreetmap.org. + ch => ch.tile.openstreetmap.org. + ci => ci.tile.openstreetmap.org. + ck => ck.tile.openstreetmap.org. + cl => cl.tile.openstreetmap.org. + cm => cm.tile.openstreetmap.org. + cn => cn.tile.openstreetmap.org. + co => co.tile.openstreetmap.org. + cr => cr.tile.openstreetmap.org. + cu => cu.tile.openstreetmap.org. + cv => cv.tile.openstreetmap.org. + cw => cw.tile.openstreetmap.org. + cx => cx.tile.openstreetmap.org. + cy => cy.tile.openstreetmap.org. + cz => cz.tile.openstreetmap.org. + de => de.tile.openstreetmap.org. + dj => dj.tile.openstreetmap.org. + dk => dk.tile.openstreetmap.org. + dm => dm.tile.openstreetmap.org. + do => do.tile.openstreetmap.org. + dz => dz.tile.openstreetmap.org. + ec => ec.tile.openstreetmap.org. + ee => ee.tile.openstreetmap.org. + eg => eg.tile.openstreetmap.org. + eh => eh.tile.openstreetmap.org. + er => er.tile.openstreetmap.org. + es => es.tile.openstreetmap.org. + et => et.tile.openstreetmap.org. + fi => fi.tile.openstreetmap.org. + fj => fj.tile.openstreetmap.org. + fk => fk.tile.openstreetmap.org. + fm => fm.tile.openstreetmap.org. + fo => fo.tile.openstreetmap.org. + fr => fr.tile.openstreetmap.org. + ga => ga.tile.openstreetmap.org. + gb => gb.tile.openstreetmap.org. + gd => gd.tile.openstreetmap.org. + ge => ge.tile.openstreetmap.org. + gf => gf.tile.openstreetmap.org. + gg => gg.tile.openstreetmap.org. + gh => gh.tile.openstreetmap.org. + gi => gi.tile.openstreetmap.org. + gl => gl.tile.openstreetmap.org. + gm => gm.tile.openstreetmap.org. + gn => gn.tile.openstreetmap.org. + gp => gp.tile.openstreetmap.org. + gq => gq.tile.openstreetmap.org. + gr => gr.tile.openstreetmap.org. + gs => gs.tile.openstreetmap.org. + gt => gt.tile.openstreetmap.org. + gu => gu.tile.openstreetmap.org. + gw => gw.tile.openstreetmap.org. + gy => gy.tile.openstreetmap.org. + hk => hk.tile.openstreetmap.org. + hm => hm.tile.openstreetmap.org. + hn => hn.tile.openstreetmap.org. + hr => hr.tile.openstreetmap.org. + ht => ht.tile.openstreetmap.org. + hu => hu.tile.openstreetmap.org. + id => id.tile.openstreetmap.org. + ie => ie.tile.openstreetmap.org. + il => il.tile.openstreetmap.org. + im => im.tile.openstreetmap.org. + in => in.tile.openstreetmap.org. + io => io.tile.openstreetmap.org. + iq => iq.tile.openstreetmap.org. + ir => ir.tile.openstreetmap.org. + is => is.tile.openstreetmap.org. + it => it.tile.openstreetmap.org. + je => je.tile.openstreetmap.org. + jm => jm.tile.openstreetmap.org. + jo => jo.tile.openstreetmap.org. + jp => jp.tile.openstreetmap.org. + ke => ke.tile.openstreetmap.org. + kg => kg.tile.openstreetmap.org. + kh => kh.tile.openstreetmap.org. + ki => ki.tile.openstreetmap.org. + km => km.tile.openstreetmap.org. + kn => kn.tile.openstreetmap.org. + kp => kp.tile.openstreetmap.org. + kr => kr.tile.openstreetmap.org. + kw => kw.tile.openstreetmap.org. + ky => ky.tile.openstreetmap.org. + kz => kz.tile.openstreetmap.org. + la => la.tile.openstreetmap.org. + lb => lb.tile.openstreetmap.org. + lc => lc.tile.openstreetmap.org. + li => li.tile.openstreetmap.org. + lk => lk.tile.openstreetmap.org. + lr => lr.tile.openstreetmap.org. + ls => ls.tile.openstreetmap.org. + lt => lt.tile.openstreetmap.org. + lu => lu.tile.openstreetmap.org. + lv => lv.tile.openstreetmap.org. + ly => ly.tile.openstreetmap.org. + ma => ma.tile.openstreetmap.org. + mc => mc.tile.openstreetmap.org. + md => md.tile.openstreetmap.org. + me => me.tile.openstreetmap.org. + mf => mf.tile.openstreetmap.org. + mg => mg.tile.openstreetmap.org. + mh => mh.tile.openstreetmap.org. + mk => mk.tile.openstreetmap.org. + ml => ml.tile.openstreetmap.org. + mm => mm.tile.openstreetmap.org. + mn => mn.tile.openstreetmap.org. + mo => mo.tile.openstreetmap.org. + mp => mp.tile.openstreetmap.org. + mq => mq.tile.openstreetmap.org. + mr => mr.tile.openstreetmap.org. + ms => ms.tile.openstreetmap.org. + mt => mt.tile.openstreetmap.org. + mu => mu.tile.openstreetmap.org. + mv => mv.tile.openstreetmap.org. + mw => mw.tile.openstreetmap.org. + mx => mx.tile.openstreetmap.org. + my => my.tile.openstreetmap.org. + mz => mz.tile.openstreetmap.org. + na => na.tile.openstreetmap.org. + nc => nc.tile.openstreetmap.org. + ne => ne.tile.openstreetmap.org. + nf => nf.tile.openstreetmap.org. + ng => ng.tile.openstreetmap.org. + ni => ni.tile.openstreetmap.org. + nl => nl.tile.openstreetmap.org. + no => no.tile.openstreetmap.org. + np => np.tile.openstreetmap.org. + nr => nr.tile.openstreetmap.org. + nu => nu.tile.openstreetmap.org. + nz => nz.tile.openstreetmap.org. + om => om.tile.openstreetmap.org. + pa => pa.tile.openstreetmap.org. + pe => pe.tile.openstreetmap.org. + pf => pf.tile.openstreetmap.org. + pg => pg.tile.openstreetmap.org. + ph => ph.tile.openstreetmap.org. + pk => pk.tile.openstreetmap.org. + pl => pl.tile.openstreetmap.org. + pm => pm.tile.openstreetmap.org. + pn => pn.tile.openstreetmap.org. + pr => pr.tile.openstreetmap.org. + ps => ps.tile.openstreetmap.org. + pt => pt.tile.openstreetmap.org. + pw => pw.tile.openstreetmap.org. + py => py.tile.openstreetmap.org. + qa => qa.tile.openstreetmap.org. + re => re.tile.openstreetmap.org. + ro => ro.tile.openstreetmap.org. + rs => rs.tile.openstreetmap.org. + ru => ru.tile.openstreetmap.org. + rw => rw.tile.openstreetmap.org. + sa => sa.tile.openstreetmap.org. + sb => sb.tile.openstreetmap.org. + sc => sc.tile.openstreetmap.org. + sd => sd.tile.openstreetmap.org. + se => se.tile.openstreetmap.org. + sg => sg.tile.openstreetmap.org. + sh => sh.tile.openstreetmap.org. + si => si.tile.openstreetmap.org. + sj => sj.tile.openstreetmap.org. + sk => sk.tile.openstreetmap.org. + sl => sl.tile.openstreetmap.org. + sm => sm.tile.openstreetmap.org. + sn => sn.tile.openstreetmap.org. + so => so.tile.openstreetmap.org. + sr => sr.tile.openstreetmap.org. + st => st.tile.openstreetmap.org. + sv => sv.tile.openstreetmap.org. + sx => sx.tile.openstreetmap.org. + sy => sy.tile.openstreetmap.org. + sz => sz.tile.openstreetmap.org. + tc => tc.tile.openstreetmap.org. + td => td.tile.openstreetmap.org. + tf => tf.tile.openstreetmap.org. + tg => tg.tile.openstreetmap.org. + th => th.tile.openstreetmap.org. + tj => tj.tile.openstreetmap.org. + tk => tk.tile.openstreetmap.org. + tl => tl.tile.openstreetmap.org. + tm => tm.tile.openstreetmap.org. + tn => tn.tile.openstreetmap.org. + to => to.tile.openstreetmap.org. + tr => tr.tile.openstreetmap.org. + tt => tt.tile.openstreetmap.org. + tv => tv.tile.openstreetmap.org. + tw => tw.tile.openstreetmap.org. + tz => tz.tile.openstreetmap.org. + ua => ua.tile.openstreetmap.org. + ug => ug.tile.openstreetmap.org. + um => um.tile.openstreetmap.org. + us => us.tile.openstreetmap.org. + uy => uy.tile.openstreetmap.org. + uz => uz.tile.openstreetmap.org. + va => va.tile.openstreetmap.org. + vc => vc.tile.openstreetmap.org. + ve => ve.tile.openstreetmap.org. + vg => vg.tile.openstreetmap.org. + vi => vi.tile.openstreetmap.org. + vn => vn.tile.openstreetmap.org. + vu => vu.tile.openstreetmap.org. + wf => wf.tile.openstreetmap.org. + ws => ws.tile.openstreetmap.org. + xx => xx.tile.openstreetmap.org. + ye => ye.tile.openstreetmap.org. + yt => yt.tile.openstreetmap.org. + za => za.tile.openstreetmap.org. + zm => zm.tile.openstreetmap.org. + zw => zw.tile.openstreetmap.org. + } + } + } + } +} diff --git a/cookbooks/geodns/templates/default/cron.erb b/cookbooks/geodns/templates/default/cron.erb deleted file mode 100644 index 5ab93aeb4..000000000 --- a/cookbooks/geodns/templates/default/cron.erb +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -rsync -zt rsync://countries-ns.mdc.dk/zone/zz.countries.nerd.dk.rbldnsd /etc/powerdns/countries.conf -pdns_control rediscover >/dev/null diff --git a/cookbooks/geodns/templates/default/geo.conf.erb b/cookbooks/geodns/templates/default/geo.conf.erb deleted file mode 100644 index 2a5cdf95e..000000000 --- a/cookbooks/geodns/templates/default/geo.conf.erb +++ /dev/null @@ -1,25 +0,0 @@ -# Launch the geo backend -launch=geo - -# Make sure we don't cache anything as we give everybody a unique answer -query-cache-ttl=0 -cache-ttl=0 - -# Turn off wildcards for performance -#Disable wildcard parameter as no longer compatible with recent pdns -#wildcards=no - -# The zone we are managing -geo-zone=geo.openstreetmap.org - -# The SOA record for the zone -geo-soa-values=a.ns.openstreetmap.org,hostmaster.openstreetmap.org - -# The NS records for the zone -geo-ns-records=a.ns.openstreetmap.org,b.ns.openstreetmap.org,c.ns.openstreetmap.org,d.ns.openstreetmap.org - -# Map IP addresses to geographic zones -geo-ip-map-zonefile=/etc/powerdns/countries.conf - -# Map geographic zones to responses -geo-maps=/etc/powerdns/zones.d diff --git a/cookbooks/geodns/templates/default/geo.erb b/cookbooks/geodns/templates/default/geo.erb new file mode 100644 index 000000000..8c576aeff --- /dev/null +++ b/cookbooks/geodns/templates/default/geo.erb @@ -0,0 +1,15 @@ +$TTL 86400 + +@ SOA a.ns.openstreetmap.org. hostmaster.openstreetmap.org. ( + 1 ; serial + 86400 ; refresh + 172800 ; retry + 604800 ; expire + 3600 ; ncache +) + +@ 86400 NS a.ns.openstreetmap.org. +@ 86400 NS b.ns.openstreetmap.org. +@ 86400 NS c.ns.openstreetmap.org. + +tile 3600 DYNC geoip!tile diff --git a/cookbooks/geodns/templates/default/tile.conf.erb b/cookbooks/geodns/templates/default/tile.conf.erb deleted file mode 100644 index 79c123662..000000000 --- a/cookbooks/geodns/templates/default/tile.conf.erb +++ /dev/null @@ -1,498 +0,0 @@ -# Name (within geo.openstreetmap.org) we are handling -$RECORD tile -# Domain within which our responses lie -$ORIGIN tile.openstreetmap.org. -# Afghanistan -4 af -# Åland Islands -248 ax -# Albania -8 al -# Algeria -12 dz -# American Samoa -16 as -# Andorra -20 ad -# Angola -24 ao -# Anguilla -660 ai -# Antarctica -10 aq -# Antigua and Barbuda -28 ag -# Argentina -32 ar -# Armenia -51 am -# Aruba -533 aw -# Australia -36 au -# Austria -40 at -# Azerbaijan -31 az -# Bahamas -44 bs -# Bahrain -48 bh -# Bangladesh -50 bd -# Barbados -52 bb -# Belarus -112 by -# Belgium -56 be -# Belize -84 bz -# Benin -204 bj -# Bermuda -60 bm -# Bhutan -64 bt -# Bolivia, Plurinational State of -68 bo -# Bosnia and Herzegovina -70 ba -# Botswana -72 bw -# Bouvet Island -74 bv -# Brazil -76 br -# British Indian Ocean Territory -86 io -# Brunei Darussalam -96 bn -# Bulgaria -100 bg -# Burkina Faso -854 bf -# Burundi -108 bi -# Cambodia -116 kh -# Cameroon -120 cm -# Canada -124 ca -# Cape Verde -132 cv -# Cayman Islands -136 ky -# Central African Republic -140 cf -# Chad -148 td -# Chile -152 cl -# China -156 cn -# Christmas Island -162 cx -# Cocos (Keeling) Islands -166 cc -# Colombia -170 co -# Comoros -174 km -# Congo -178 cg -# Congo, The Democratic Republic of the -180 cd -# Cook Islands -184 ck -# Costa Rica -188 cr -# Côte d'Ivoire -384 ci -# Croatia -191 hr -# Cuba -192 cu -# Cyprus -196 cy -# Czech Republic -203 cz -# Denmark -208 dk -# Djibouti -262 dj -# Dominica -212 dm -# Dominican Republic -214 do -# Ecuador -218 ec -# Egypt -818 eg -# El Salvador -222 sv -# Equatorial Guinea -226 gq -# Eritrea -232 er -# Estonia -233 ee -# Ethiopia -231 et -# Falkland Islands (Malvinas) -238 fk -# Faroe Islands -234 fo -# Fiji -242 fj -# Finland -246 fi -# France -250 fr -# French Guiana -254 gf -# French Polynesia -258 pf -# French Southern Territories -260 tf -# Gabon -266 ga -# Gambia -270 gm -# Georgia -268 ge -# Germany -276 de -# Ghana -288 gh -# Gibraltar -292 gi -# Greece -300 gr -# Greenland -304 gl -# Grenada -308 gd -# Guadeloupe -312 gp -# Guam -316 gu -# Guatemala -320 gt -# Guernsey -831 gg -# Guinea -324 gn -# Guinea-Bissau -624 gw -# Guyana -328 gy -# Haiti -332 ht -# Heard Island and McDonald Islands -334 hm -# Holy See (Vatican City State) -336 va -# Honduras -340 hn -# Hong Kong -344 hk -# Hungary -348 hu -# Iceland -352 is -# India -356 in -# Indonesia -360 id -# Iran, Islamic Republic of -364 ir -# Iraq -368 iq -# Ireland -372 ie -# Isle of Man -833 im -# Israel -376 il -# Italy -380 it -# Jamaica -388 jm -# Japan -392 jp -# Jersey -832 je -# Jordan -400 jo -# Kazakhstan -398 kz -# Kenya -404 ke -# Kiribati -296 ki -# Korea, Democratic People's Republic of -408 kp -# Korea, Republic of -410 kr -# Kuwait -414 kw -# Kyrgyzstan -417 kg -# Lao People's Democratic Republic -418 la -# Latvia -428 lv -# Lebanon -422 lb -# Lesotho -426 ls -# Liberia -430 lr -# Libyan Arab Jamahiriya -434 ly -# Liechtenstein -438 li -# Lithuania -440 lt -# Luxembourg -442 lu -# Macao -446 mo -# Macedonia, Republic of -807 mk -# Madagascar -450 mg -# Malawi -454 mw -# Malaysia -458 my -# Maldives -462 mv -# Mali -466 ml -# Malta -470 mt -# Marshall Islands -584 mh -# Martinique -474 mq -# Mauritania -478 mr -# Mauritius -480 mu -# Mayotte -175 yt -# Mexico -484 mx -# Micronesia, Federated States of -583 fm -# Moldova, Republic of -498 md -# Monaco -492 mc -# Mongolia -496 mn -# Montenegro -499 me -# Montserrat -500 ms -# Morocco -504 ma -# Mozambique -508 mz -# Myanmar -104 mm -# Namibia -516 na -# Nauru -520 nr -# Nepal -524 np -# Netherlands -528 nl -# Netherlands Antilles -530 an -# New Caledonia -540 nc -# New Zealand -554 nz -# Nicaragua -558 ni -# Niger -562 ne -# Nigeria -566 ng -# Niue -570 nu -# Norfolk Island -574 nf -# Northern Mariana Islands -580 mp -# Norway -578 no -# Oman -512 om -# Pakistan -586 pk -# Palau -585 pw -# Palestinian Territory, Occupied -275 ps -# Panama -591 pa -# Papua New Guinea -598 pg -# Paraguay -600 py -# Peru -604 pe -# Philippines -608 ph -# Pitcairn -612 pn -# Poland -616 pl -# Portugal -620 pt -# Puerto Rico -630 pr -# Qatar -634 qa -# Reunion -638 re -# Romania -642 ro -# Russian Federation -643 ru -# Rwanda -646 rw -# Saint Barthélemy -652 bl -# Saint Helena -654 sh -# Saint Kitts and Nevis -659 kn -# Saint Lucia -662 lc -# Saint Martin (French part) -663 mf -# Saint Pierre and Miquelon -666 pm -# Saint Vincent and the Grenadines -670 vc -# Samoa -882 ws -# San Marino -674 sm -# Sao Tome and Principe -678 st -# Saudi Arabia -682 sa -# Senegal -686 sn -# Serbia -688 rs -# Seychelles -690 sc -# Sierra Leone -694 sl -# Singapore -702 sg -# Slovakia -703 sk -# Slovenia -705 si -# Solomon Islands -90 sb -# Somalia -706 so -# South Africa -710 za -# South Georgia and the South Sandwich Islands -239 gs -# Spain -724 es -# Sri Lanka -144 lk -# Sudan -736 sd -# Suriname -740 sr -# Svalbard and Jan Mayen -744 sj -# Swaziland -748 sz -# Sweden -752 se -# Switzerland -756 ch -# Syrian Arab Republic -760 sy -# Taiwan, Province of China -158 tw -# Tajikistan -762 tj -# Tanzania, United Republic of -834 tz -# Thailand -764 th -# Timor-Leste -626 tl -# Togo -768 tg -# Tokelau -772 tk -# Tonga -776 to -# Trinidad and Tobago -780 tt -# Tunisia -788 tn -# Turkey -792 tr -# Turkmenistan -795 tm -# Turks and Caicos Islands -796 tc -# Tuvalu -798 tv -# Uganda -800 ug -# Ukraine -804 ua -# United Arab Emirates -784 ae -# United Kingdom -826 gb -# United States -840 us -# United States Minor Outlying Islands -581 um -# Uruguay -858 uy -# Uzbekistan -860 uz -# Vanuatu -548 vu -# Venezuela, Bolivarian republic of -862 ve -# Viet Nam -704 vn -# Virgin Islands, British -92 vg -# Virgin Islands, U.S. -850 vi -# Wallis and Futuna -876 wf -# Western Sahara -732 eh -# Yemen -887 ye -# Zambia -894 zm -# Zimbabwe -716 zw -# Default response -0 xx