mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-15 22:27:26 +08:00
magic dns (#813)
This patch implements: 1. A dns server that handles .et.net. zone in local and forward all other queries to system dns server. 2. A dns server instance which is a singleton in one machine, using one specific tcp port to be exclusive with each other. this instance is responsible for config system dns and run the dns server to handle dns queries. 3. A dns client instance that all easytier instance will run one, this instance will try to connect to dns server instance, and update the dns record in the dns server instance. this pr only implements the system config for windows. linux & mac will do later.
This commit is contained in:
49
easytier/src/proto/magic_dns.proto
Normal file
49
easytier/src/proto/magic_dns.proto
Normal file
@@ -0,0 +1,49 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "common.proto";
|
||||
import "cli.proto";
|
||||
|
||||
package magic_dns;
|
||||
|
||||
message DnsRecordA {
|
||||
string name = 1;
|
||||
common.Ipv4Addr value = 2;
|
||||
int32 ttl = 3;
|
||||
}
|
||||
|
||||
message DnsRecordSOA {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message DnsRecord {
|
||||
oneof record {
|
||||
DnsRecordA a = 1;
|
||||
DnsRecordSOA soa = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message DnsRecordList {
|
||||
repeated DnsRecord records = 1;
|
||||
}
|
||||
|
||||
message UpdateDnsRecordRequest {
|
||||
string zone = 1;
|
||||
repeated cli.Route routes = 2;
|
||||
}
|
||||
|
||||
message GetDnsRecordResponse {
|
||||
map<string, DnsRecordList> records = 1;
|
||||
}
|
||||
|
||||
message HandshakeRequest {}
|
||||
|
||||
message HandshakeResponse {}
|
||||
|
||||
service MagicDnsServerRpc {
|
||||
rpc Handshake(HandshakeRequest) returns (HandshakeResponse) {}
|
||||
rpc Heartbeat(common.Void) returns (common.Void) {}
|
||||
rpc UpdateDnsRecord(UpdateDnsRecordRequest) returns (common.Void) {}
|
||||
rpc GetDnsRecord(common.Void) returns (GetDnsRecordResponse) {}
|
||||
}
|
||||
Reference in New Issue
Block a user