diff --git a/core/src/mindustry/net/Dns.java b/core/src/mindustry/net/Dns.java index 5bd1503e8a..749a75bcce 100644 --- a/core/src/mindustry/net/Dns.java +++ b/core/src/mindustry/net/Dns.java @@ -2,6 +2,7 @@ package mindustry.net; import arc.func.*; import arc.math.*; +import arc.net.dns.*; import arc.struct.*; import arc.util.*; @@ -15,7 +16,7 @@ public class Dns{ private static final Pattern ipPattern = Pattern.compile("^((0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)\\.){3}(0|1\\d?\\d?|2[0-4]?\\d?|25[0-5]?|[3-9]\\d?)$"); private static final int aRecord = 1, srvRecord = 33; private static IntMap>> cache = new IntMap<>(); - private static Seq nameservers = Seq.with(new InetSocketAddress("1.1.1.1", 53), new InetSocketAddress("8.8.8.8", 53)); + private static Seq defNameservers = Seq.with(new InetSocketAddress("1.1.1.1", 53), new InetSocketAddress("8.8.8.8", 53)); static void resolve(int type, String domain, Func reader, Cons> result, Cons error){ ObjectMap> map; @@ -30,7 +31,7 @@ public class Dns{ } } - send(Seq.with(new InetSocketAddress("1.1.1.1", 53)), 0, type, domain, reader, records -> { + send(ArcDns.getNameservers(), 0, type, domain, reader, records -> { synchronized(cache){ //cache the records map.put(domain, records);