[GH-ISSUE #112] edns-client-subnet #224

Closed
opened 2026-03-01 17:24:40 +03:00 by kerem · 0 comments
Owner

Originally created by @MolenZhang on GitHub (Dec 4, 2018).
Original GitHub issue: https://github.com/abh/geodns/issues/112

Hi:
Sorry to all moguls first,may be i should not ask this question in here,i just need some advise.I am learning edns recently, and with my code like bellow:

o := new(dns.OPT)
	o.Hdr.Name = "."
	o.Hdr.Rrtype = dns.TypeOPT
	e := new(dns.EDNS0_SUBNET)
	e.Code = dns.EDNS0SUBNET
	e.Family = 1                // 1 for IPv4 source address, 2 for IPv6
	e.SourceNetmask = uint8(32) // 32 for IPV4, 128 for IPv6
	e.SourceScope = 0
	e.Address = net.ParseIP(ip).To4() // for IPv4
	o.Option = append(o.Option, e)
	m.Extra = append(m.Extra, o)

Now what puzzled me was my upstream server which is internal nameserver do not support edns.What i mean is:I add edns to my code and send domain resolve to Google public dnsServer through my clientIP. Of course i get an expected answer. Now i use my upstream server(for example 119.2.2.2) to take the place of google public dnsServer, I can not get the true resp ip. What i want to say is my upstream server may could not support edns. What should I do next step.

Originally created by @MolenZhang on GitHub (Dec 4, 2018). Original GitHub issue: https://github.com/abh/geodns/issues/112 Hi: Sorry to all moguls first,may be i should not ask this question in here,i just need some advise.I am learning edns recently, and with my code like bellow: ``` o := new(dns.OPT) o.Hdr.Name = "." o.Hdr.Rrtype = dns.TypeOPT e := new(dns.EDNS0_SUBNET) e.Code = dns.EDNS0SUBNET e.Family = 1 // 1 for IPv4 source address, 2 for IPv6 e.SourceNetmask = uint8(32) // 32 for IPV4, 128 for IPv6 e.SourceScope = 0 e.Address = net.ParseIP(ip).To4() // for IPv4 o.Option = append(o.Option, e) m.Extra = append(m.Extra, o) ``` Now what puzzled me was my upstream server which is internal nameserver do not support edns.What i mean is:I add edns to my code and send domain resolve to Google public dnsServer through my clientIP. Of course i get an expected answer. Now i use my upstream server(for example 119.2.2.2) to take the place of google public dnsServer, I can not get the true resp ip. What i want to say is my upstream server may could not support edns. What should I do next step.
kerem closed this issue 2026-03-01 17:24:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/geodns#224
No description provided.