@@ -36,6 +36,8 @@ pub const ALL: &dyn crate::Resolver<'static> = &&[
36
36
OPENDNS ,
37
37
#[ cfg( feature = "google" ) ]
38
38
GOOGLE ,
39
+ #[ cfg( feature = "cloudflare" ) ]
40
+ CLOUDFLARE ,
39
41
] ;
40
42
41
43
/// Combined OpenDNS IPv4 and IPv6 options.
@@ -116,6 +118,41 @@ pub const GOOGLE_V6: &dyn crate::Resolver<'static> = &Resolver::new_static(
116
118
DNSClass :: IN ,
117
119
) ;
118
120
121
+ /// Combined Cloudflare DNS IPv4 and IPv6 options
122
+ #[ cfg( feature = "cloudflare" ) ]
123
+ #[ cfg_attr( docsrs, doc( cfg( feature = "cloudflare" ) ) ) ]
124
+ pub const CLOUDFLARE : & dyn crate :: Resolver < ' static > = & & [ CLOUDFLARE_V4 , CLOUDFLARE_V6 ] ;
125
+
126
+ /// Cloudflare DNS IPv4 DNS resolver options
127
+ #[ cfg( feature = "cloudflare" ) ]
128
+ #[ cfg_attr( docsrs, doc( cfg( feature = "cloudflare" ) ) ) ]
129
+ pub const CLOUDFLARE_V4 : & dyn crate :: Resolver < ' static > = & Resolver :: new_static (
130
+ "whoami.cloudflare" ,
131
+ & [
132
+ IpAddr :: V4 ( Ipv4Addr :: new ( 1 , 1 , 1 , 1 ) ) ,
133
+ IpAddr :: V4 ( Ipv4Addr :: new ( 1 , 0 , 0 , 1 ) ) ,
134
+ ] ,
135
+ DEFAULT_DNS_PORT ,
136
+ QueryMethod :: TXT ,
137
+ DNSClass :: CH ,
138
+ ) ;
139
+
140
+ /// Cloudflare DNS IPv6 DNS resolver options
141
+ #[ cfg( feature = "cloudflare" ) ]
142
+ #[ cfg_attr( docsrs, doc( cfg( feature = "cloudflare" ) ) ) ]
143
+ pub const CLOUDFLARE_V6 : & dyn crate :: Resolver < ' static > = & Resolver :: new_static (
144
+ "whoami.cloudflare" ,
145
+ & [
146
+ // 2606:4700:4700::1111
147
+ IpAddr :: V6 ( Ipv6Addr :: new ( 9734 , 18176 , 18176 , 0 , 0 , 0 , 0 , 4369 ) ) ,
148
+ // 2606:4700:4700::1001
149
+ IpAddr :: V6 ( Ipv6Addr :: new ( 9734 , 18176 , 18176 , 0 , 0 , 0 , 0 , 4097 ) ) ,
150
+ ] ,
151
+ DEFAULT_DNS_PORT ,
152
+ QueryMethod :: TXT ,
153
+ DNSClass :: CH ,
154
+ ) ;
155
+
119
156
///////////////////////////////////////////////////////////////////////////////
120
157
// Error
121
158
0 commit comments