Skip to content

Commit d6c1def

Browse files
committed
Refactor build workflow to use TechnitiumLibrary as submodule and update build.md
Replaced all AssemblyReference usages with ProjectReference entries and added the TechnitiumLibrary repository as a git submodule for unified development. Updated build.md to reflect the simplified workflow, separating debug builds from publishing steps for Windows and Linux. Cleaned old instructions dependent on prebuilt release binaries and aligned documentation with the new integrated solution layout.
1 parent c7e4498 commit d6c1def

7 files changed

Lines changed: 423 additions & 92 deletions

File tree

DnsServer.sln

Lines changed: 361 additions & 0 deletions
Large diffs are not rendered by default.

DnsServerCore.ApplicationCommon/DnsServerCore.ApplicationCommon.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<Reference Include="TechnitiumLibrary.Net">
20-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll</HintPath>
21-
<Private>false</Private>
22-
</Reference>
19+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Net\TechnitiumLibrary.Net.csproj" />
2320
</ItemGroup>
2421

2522
</Project>

DnsServerCore.HttpApi/DnsServerCore.HttpApi.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,8 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<Reference Include="TechnitiumLibrary">
25-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.dll</HintPath>
26-
</Reference>
27-
<Reference Include="TechnitiumLibrary.Net">
28-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll</HintPath>
29-
<Private>false</Private>
30-
</Reference>
24+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Net\TechnitiumLibrary.Net.csproj" />
25+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary\TechnitiumLibrary.csproj" />
3126
</ItemGroup>
3227

3328
</Project>

DnsServerCore/DnsServerCore.csproj

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,11 @@
2323
<ItemGroup>
2424
<ProjectReference Include="..\DnsServerCore.ApplicationCommon\DnsServerCore.ApplicationCommon.csproj" />
2525
<ProjectReference Include="..\DnsServerCore.HttpApi\DnsServerCore.HttpApi.csproj" />
26-
</ItemGroup>
27-
28-
<ItemGroup>
29-
<Reference Include="TechnitiumLibrary">
30-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.dll</HintPath>
31-
</Reference>
32-
<Reference Include="TechnitiumLibrary.ByteTree">
33-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.ByteTree.dll</HintPath>
34-
</Reference>
35-
<Reference Include="TechnitiumLibrary.IO">
36-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.IO.dll</HintPath>
37-
</Reference>
38-
<Reference Include="TechnitiumLibrary.Net">
39-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll</HintPath>
40-
</Reference>
41-
<Reference Include="TechnitiumLibrary.Security.OTP">
42-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Security.OTP.dll</HintPath>
43-
</Reference>
26+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.ByteTree\TechnitiumLibrary.ByteTree.csproj" />
27+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.IO\TechnitiumLibrary.IO.csproj" />
28+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Net\TechnitiumLibrary.Net.csproj" />
29+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Security.OTP\TechnitiumLibrary.Security.OTP.csproj" />
30+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary\TechnitiumLibrary.csproj" />
4431
</ItemGroup>
4532

4633
<ItemGroup>

DnsServerSystemTrayApp/DnsServerSystemTrayApp.csproj

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@
2020
<RepositoryUrl>https://github.com/TechnitiumSoftware/DnsServer</RepositoryUrl>
2121
</PropertyGroup>
2222

23-
<ItemGroup>
24-
<Reference Include="TechnitiumLibrary.IO">
25-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.IO.dll</HintPath>
26-
</Reference>
27-
<Reference Include="TechnitiumLibrary.Net">
28-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll</HintPath>
29-
</Reference>
30-
</ItemGroup>
31-
3223
<ItemGroup>
3324
<Compile Update="Properties\Resources.Designer.cs">
3425
<AutoGen>True</AutoGen>
@@ -46,6 +37,11 @@
4637
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.10" />
4738
</ItemGroup>
4839

40+
<ItemGroup>
41+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.IO\TechnitiumLibrary.IO.csproj" />
42+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Net\TechnitiumLibrary.Net.csproj" />
43+
</ItemGroup>
44+
4945
<ItemGroup>
5046
<EmbeddedResource Update="Properties\Resources.resx">
5147
<Generator>ResXFileCodeGenerator</Generator>

DnsServerWindowsService/DnsServerWindowsService.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@
1919
<PackageId>DnsServerWindowsService</PackageId>
2020
</PropertyGroup>
2121

22-
<ItemGroup>
23-
<Reference Include="TechnitiumLibrary.Net.Firewall">
24-
<HintPath>..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.Firewall.dll</HintPath>
25-
</Reference>
26-
</ItemGroup>
27-
2822
<ItemGroup>
2923
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
3024
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.10" />
3125
</ItemGroup>
3226

3327
<ItemGroup>
3428
<ProjectReference Include="..\DnsServerCore\DnsServerCore.csproj" />
29+
<ProjectReference Include="..\TechnitiumLibrary\TechnitiumLibrary.Net.Firewall\TechnitiumLibrary.Net.Firewall.csproj" />
3530
</ItemGroup>
3631

3732
<ItemGroup>

build.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,75 @@
11
# Build Instructions
22

3-
## For Windows
3+
## Debug Builds
44

5-
To build the Technitium DNS Server Windows Setup, you need to install [Microsoft Visual Studio Community 2022 (VS2022)](https://visualstudio.microsoft.com/vs/) and [Inno Setup](https://jrsoftware.org/isinfo.php) on your computer. Once you have it installed, follow the steps below:
5+
### Windows or Linux
66

7-
1. Open VS2022 and use the "Clone a repository" option to clone the [TechnitiumLibrary](https://github.com/TechnitiumSoftware/TechnitiumLibrary) project using the `https://github.com/TechnitiumSoftware/TechnitiumLibrary.git` URL. Once the repository is cloned and opened in VS2022, select the build mode to "Release" from the dropdown box in the toolbar and use the Build > Build Solution menu to build it.
7+
1. Clone the repository and initialize the submodule.
88

9-
2. Open VS2022 and use the "Clone a repository" option to clone the [DnsServer](https://github.com/TechnitiumSoftware/DnsServer) project using the `https://github.com/TechnitiumSoftware/DnsServer.git` URL in the same parent folder that you had cloned the TechnitiumLibrary repository in previous step. Once the repository is cloned and opened in VS2022, right click on the `DnsServerSystemTrayApp` project and click on the Publish menu to open the publish page. Click the Publish button on it to publish the project in `DnsServer\DnsServerWindowsSetup\publish` folder. Similarly, right click on the `DnsServerWindowsService` project and click on the Publish menu to open publish page and use the Publish button to publish the project in the same folder as that of the previous project.
9+
```
10+
git clone https://github.com/TechnitiumSoftware/DnsServer.git
11+
cd DnsServer
12+
git submodule update --init --recursive
13+
```
14+
15+
2. Open `DnsServer.sln` in Visual Studio (Windows) or build with `dotnet` on Linux. Select **Debug** and build.
16+
The TechnitiumLibrary source is built automatically as part of the solution.
17+
18+
---
19+
20+
## Windows Publishing
21+
22+
To create the Technitium DNS Server Windows Setup, install **Visual Studio 2022** and **Inno Setup**.
23+
24+
1. Open `DnsServer.sln`, select **Release**, and build the solution.
1025

11-
3. Open the `DnsServer\DnsServerWindowsSetup\DnsServerSetup.iss` file in Inno Setup and click on the Build > Compile menu to generate a Windows setup in `DnsServerWindowsSetup\Release` folder that you can then use to install Technitium DNS Server on Windows.
26+
2. Publish the following projects to `DnsServer\DnsServerWindowsSetup\publish`:
1227

13-
## For Linux
28+
* `DnsServerSystemTrayApp`
29+
* `DnsServerWindowsService`
1430

15-
Follow the instructions given below to build and install the DNS server from source. These instructions are written for Ubuntu and Raspberry Pi OS but, you can easily follow similar steps on your favorite distro.
31+
3. Open `DnsServerWindowsSetup\DnsServerSetup.iss` in Inno Setup and compile it to generate the installer.
32+
33+
---
34+
35+
## Linux Publishing
36+
37+
### 1. Install prerequisites
1638

17-
1. Install prerequisites like curl and git.
1839
```
1940
sudo apt update
2041
sudo apt install curl git -y
2142
```
2243

23-
2. Follow the [install instructions](https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-install?tabs=dotnet9&pivots=os-linux-ubuntu-2404) to be able to install ASP.NET Core SDK on your distro. Use the instructions given in the link to install the repository for other distros not shown in below examples:
44+
### 2. Install ASP.NET Core SDK
2445

25-
- Ubuntu 24.04
26-
```
27-
sudo add-apt-repository ppa:dotnet/backports
28-
sudo apt update
29-
```
46+
Follow Microsoft’s distribution-specific instructions.
3047

31-
- Raspberry Pi OS
32-
```
33-
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
34-
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
35-
sudo apt update
36-
```
48+
### 3. Install ASP.NET Core 9 SDK and optional QUIC support
3749

38-
3. Install ASP.NET Core 9 SDK and `libmsquic` for DNS-over-QUIC support.
3950
```
4051
sudo apt install dotnet-sdk-9.0 libmsquic -y
4152
```
4253

43-
Note! If you do not plan to use DNS-over-QUIC or HTTP/3 support, or you intend to just build a docker image then you can skip installing `libmsquic`.
54+
### 4. Clone repository and initialize submodule
4455

45-
4. Clone the source code for both [TechnitiumLibrary](https://github.com/TechnitiumSoftware/TechnitiumLibrary) and [DnsServer](https://github.com/TechnitiumSoftware/DnsServer) into the current folder.
4656
```
47-
git clone --depth 1 https://github.com/TechnitiumSoftware/TechnitiumLibrary.git TechnitiumLibrary
4857
git clone --depth 1 https://github.com/TechnitiumSoftware/DnsServer.git DnsServer
58+
cd DnsServer
59+
git submodule update --init --recursive
4960
```
5061

51-
5. Build the TechnitiumLibrary source.
52-
```
53-
dotnet build TechnitiumLibrary/TechnitiumLibrary.ByteTree/TechnitiumLibrary.ByteTree.csproj -c Release
54-
dotnet build TechnitiumLibrary/TechnitiumLibrary.Net/TechnitiumLibrary.Net.csproj -c Release
55-
dotnet build TechnitiumLibrary/TechnitiumLibrary.Security.OTP/TechnitiumLibrary.Security.OTP.csproj -c Release
56-
```
62+
### 5. Publish the DNS server
5763

58-
6. Build the DnsServer source.
5964
```
60-
dotnet publish DnsServer/DnsServerApp/DnsServerApp.csproj -c Release
65+
dotnet publish DnsServerApp/DnsServerApp.csproj -c Release
6166
```
6267

63-
7. Install the DNS server as a systemd service.
64-
65-
Note! Skip this step if you wish to build and use docker image.
68+
### 6. Install as a systemd service (skip if using Docker)
6669

6770
```
6871
sudo mkdir -p /opt/technitium/dns
69-
sudo cp -r DnsServer/DnsServerApp/bin/Release/publish/* /opt/technitium/dns
72+
sudo cp -r DnsServerApp/bin/Release/publish/* /opt/technitium/dns
7073
sudo cp /opt/technitium/dns/systemd.service /etc/systemd/system/dns.service
7174
sudo systemctl stop systemd-resolved
7275
sudo systemctl disable systemd-resolved
@@ -76,25 +79,22 @@ sudo rm /etc/resolv.conf
7679
echo "nameserver 127.0.0.1" | sudo tee /etc/resolv.conf
7780
```
7881

79-
8. Build and run docker image.
80-
81-
Note! Skip this step if you have already installed the DNS server as a systemd service in previous step.
82-
83-
Note! Before proceeding to build a Docker image, it is required that you have installed `docker` on your computer.
84-
85-
Follow the commands given below to build a docker image for the DNS server.
82+
### 7. Build a Docker image (skip if using systemd)
8683

8784
```
8885
cd DnsServer
8986
sudo docker build -t technitium/dns-server:latest .
87+
sudo systemctl stop systemd-resolved
88+
sudo systemctl disable systemd-resolved
89+
sudo docker compose up -d
9090
```
9191

92-
You can now run the image that you have built using `docker compose` as shown below. You should edit the `docker-compose.yml` file if you wish to edit the container's configuration before running it.
92+
### 8. Access the web console
93+
94+
Open:
9395

9496
```
95-
sudo systemctl stop systemd-resolved
96-
sudo systemctl disable systemd-resolved
97-
sudo docker compose up -d
97+
http://<server-ip>:5380/
9898
```
9999

100-
9. Open the DNS server web console in a web browser using `http://<server-ip-address>:5380/` URL and set a login password to complete the installation.
100+
Set a login password to complete setup.

0 commit comments

Comments
 (0)