This commit is contained in:
Connection Refused
2019-12-02 19:51:12 +08:00
commit b2ea730984
229 changed files with 86605 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Net;
namespace Netch.Controllers
{
public class DNSController
{
public static DNS.Server.DnsServer Server = new DNS.Server.DnsServer(new Resolver());
public bool Start()
{
try
{
_ = Server.Listen(new IPEndPoint(IPAddress.IPv6Any, 53));
}
catch (Exception e)
{
Utils.Logging.Info(e.ToString());
return false;
}
return true;
}
public void Stop()
{
try
{
Server.Dispose();
}
catch (Exception e)
{
Utils.Logging.Info(e.ToString());
}
}
}
}