Skip to content

Commit e1791cd

Browse files
Ticket #4 : Add WPF client
1 parent fa53a88 commit e1791cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2865
-96
lines changed

DnsServer.sln

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.645
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29503.13
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01. Core Layer", "01. Core Layer", "{F78A8B31-336A-4688-A854-5F74E5ACC14D}"
77
EndProject
@@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2020
Directory.Build.props = Directory.Build.props
2121
EndProjectSection
2222
EndProject
23+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DnsServer.WpfClient", "src\DnsServer.WpfClient\DnsServer.WpfClient.csproj", "{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3}"
24+
EndProject
2325
Global
2426
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2527
Debug|Any CPU = Debug|Any CPU
@@ -38,6 +40,10 @@ Global
3840
{66EF4897-6A24-45D8-A8FF-354526A658FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
3941
{66EF4897-6A24-45D8-A8FF-354526A658FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
4042
{66EF4897-6A24-45D8-A8FF-354526A658FD}.Release|Any CPU.Build.0 = Release|Any CPU
43+
{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44+
{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
45+
{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
46+
{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3}.Release|Any CPU.Build.0 = Release|Any CPU
4147
EndGlobalSection
4248
GlobalSection(SolutionProperties) = preSolution
4349
HideSolutionNode = FALSE
@@ -46,6 +52,7 @@ Global
4652
{DA5C6A98-52EB-48AA-B616-C4010C222D36} = {F78A8B31-336A-4688-A854-5F74E5ACC14D}
4753
{B9EE88CB-79B0-4733-82A9-4F45306E3EF0} = {99C091AE-BDDC-4099-B953-61CB77819816}
4854
{66EF4897-6A24-45D8-A8FF-354526A658FD} = {F0A96A7D-E821-43CD-B7EB-CB5BFFAA1F5A}
55+
{C6F08D20-A313-44AE-AAE5-BFF43B86D8E3} = {99C091AE-BDDC-4099-B953-61CB77819816}
4956
EndGlobalSection
5057
GlobalSection(ExtensibilityGlobals) = postSolution
5158
SolutionGuid = {98B39694-18F2-478E-8932-3B25448E485D}

NuGet.Config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="sid" value="https://www.myget.org/F/advance-ict/api/v3/index.json" />
7+
</packageSources>
8+
</configuration>

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
[![Build status](https://ci.appveyor.com/api/projects/status/sr0ee1m56dvgv2d0?svg=true)](https://ci.appveyor.com/project/simpleidserver/dnsserver)
44
[![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/DnsServer.svg)](http://myget.org/gallery/advance-ict)
55

6+
DnsServer is an open source library enabling any DOTNET CORE applications to host a DNS server.
7+
The project implements the RFC [1034](https://tools.ietf.org/rfc/rfc1034.txt)_ and [1035](https://tools.ietf.org/rfc/rfc1035.txt).
8+
9+
For project documentation, please visit [readthedocs](https://dnsserver.readthedocs.io/en/latest/).
10+
11+
## Packages
12+
13+
| | | | |
14+
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------| -------------------------------------------------------------------------------------------------- |
15+
| `DnsServer` | [![MyGet (dev)](https://img.shields.io/myget/advance-ict/v/DnsServer.svg)](https://www.myget.org/feed/advance-ict/package/nuget/DnsServer) | [![NuGet](https://img.shields.io/nuget/v/DnsServer.svg)](https://nuget.org/packages/DnsServer) | [![NuGet](https://img.shields.io/nuget/dt/DnsServer.svg)](https://nuget.org/packages/DnsServer) |
16+
17+
618
## Contributing
719

820
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pull_requests:
44
branches:
55
only:
66
- master
7-
image: Visual Studio 2017
7+
image: Visual Studio 2019
88
nuget:
99
disable_publish_on_pr: true
1010
build_script:

docs/conf.py

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
# import os
16+
# import sys
17+
# sys.path.insert(0, os.path.abspath('.'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = u'SimpleIdServer'
23+
copyright = u'2019, SimpleIdServer'
24+
author = u'SimpleIdServer'
25+
26+
# The short X.Y version
27+
version = u''
28+
# The full version, including alpha/beta/rc tags
29+
release = u''
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# If your documentation needs a minimal Sphinx version, state it here.
35+
#
36+
# needs_sphinx = '1.0'
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
"sphinx_rtd_theme"
43+
]
44+
45+
# Add any paths that contain templates here, relative to this directory.
46+
templates_path = ['_templates']
47+
48+
# The suffix(es) of source filenames.
49+
# You can specify multiple suffix as a list of string:
50+
#
51+
# source_suffix = ['.rst', '.md']
52+
source_suffix = '.rst'
53+
54+
# The master toctree document.
55+
master_doc = 'index'
56+
57+
# The language for content autogenerated by Sphinx. Refer to documentation
58+
# for a list of supported languages.
59+
#
60+
# This is also used if you do content translation via gettext catalogs.
61+
# Usually you set "language" from the command line for these cases.
62+
language = None
63+
64+
# List of patterns, relative to source directory, that match files and
65+
# directories to ignore when looking for source files.
66+
# This pattern also affects html_static_path and html_extra_path.
67+
exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
68+
69+
# The name of the Pygments (syntax highlighting) style to use.
70+
pygments_style = None
71+
72+
73+
# -- Options for HTML output -------------------------------------------------
74+
75+
# The theme to use for HTML and HTML Help pages. See the documentation for
76+
# a list of builtin themes.
77+
#
78+
html_theme = "sphinx_rtd_theme"
79+
80+
# Theme options are theme-specific and customize the look and feel of a theme
81+
# further. For a list of options available for each theme, see the
82+
# documentation.
83+
#
84+
# html_theme_options = {}
85+
86+
# Add any paths that contain custom static files (such as style sheets) here,
87+
# relative to this directory. They are copied after the builtin static files,
88+
# so a file named "default.css" will overwrite the builtin "default.css".
89+
html_static_path = ['_static']
90+
91+
# Custom sidebar templates, must be a dictionary that maps document names
92+
# to template names.
93+
#
94+
# The default sidebars (for documents that don't match any pattern) are
95+
# defined by theme itself. Builtin themes are using these templates by
96+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
97+
# 'searchbox.html']``.
98+
#
99+
# html_sidebars = {}
100+
101+
102+
# -- Options for HTMLHelp output ---------------------------------------------
103+
104+
# Output file base name for HTML help builder.
105+
htmlhelp_basename = 'SimpleIdServerdoc'
106+
107+
108+
# -- Options for LaTeX output ------------------------------------------------
109+
110+
latex_elements = {
111+
# The paper size ('letterpaper' or 'a4paper').
112+
#
113+
# 'papersize': 'letterpaper',
114+
115+
# The font size ('10pt', '11pt' or '12pt').
116+
#
117+
# 'pointsize': '10pt',
118+
119+
# Additional stuff for the LaTeX preamble.
120+
#
121+
# 'preamble': '',
122+
123+
# Latex figure (float) alignment
124+
#
125+
# 'figure_align': 'htbp',
126+
}
127+
128+
# Grouping the document tree into LaTeX files. List of tuples
129+
# (source start file, target name, title,
130+
# author, documentclass [howto, manual, or own class]).
131+
latex_documents = [
132+
(master_doc, 'SimpleIdServer.tex', u'SimpleIdServer Documentation',
133+
u'SimpleIdServer', 'manual'),
134+
]
135+
136+
137+
# -- Options for manual page output ------------------------------------------
138+
139+
# One entry per manual page. List of tuples
140+
# (source start file, name, description, authors, manual section).
141+
man_pages = [
142+
(master_doc, 'simpleidserver', u'SimpleIdServer Documentation',
143+
[author], 1)
144+
]
145+
146+
147+
# -- Options for Texinfo output ----------------------------------------------
148+
149+
# Grouping the document tree into Texinfo files. List of tuples
150+
# (source start file, target name, title, author,
151+
# dir menu entry, description, category)
152+
texinfo_documents = [
153+
(master_doc, 'SimpleIdServer', u'SimpleIdServer Documentation',
154+
author, 'SimpleIdServer', 'One line description of project.',
155+
'Miscellaneous'),
156+
]
157+
158+
159+
# -- Options for Epub output -------------------------------------------------
160+
161+
# Bibliographic Dublin Core info.
162+
epub_title = project
163+
164+
# The unique identifier of the text. This can be a ISBN number
165+
# or the project homepage.
166+
#
167+
# epub_identifier = ''
168+
169+
# A unique identification for the text.
170+
#
171+
# epub_uid = ''
172+
173+
# A list of files that should not be packed into the epub file.
174+
epub_exclude_files = ['search.html']

docs/index.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Welcome to DnsServer
2+
====================
3+
4+
DnsServer is an open source library enabling any DOTNET CORE applications to host a DNS server.
5+
The project implements the RFC `1034`_ and `1035`_.
6+
7+
Github: https://github.com/simpleidserver/DnsServer
8+
9+
Nuget feed: https://www.myget.org/F/advance-ict/api/v3/index.json
10+
11+
.. toctree::
12+
:maxdepth: 3
13+
:hidden:
14+
:caption: Getting started
15+
16+
intro/getting-started-dns
17+
18+
.. toctree::
19+
:maxdepth: 3
20+
:hidden:
21+
:caption: Reference
22+
23+
reference/dnsserveroptions
24+
25+
.. _1034: https://tools.ietf.org/rfc/rfc1034.txt
26+
.. _1035: https://tools.ietf.org/rfc/rfc1035.txt

docs/intro/getting-started-dns.rst

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
How to setup an DNS server ?
2+
============================
3+
4+
A DNS server can be hosted in any DOTNET CORE project like ASP.NET CORE or Console application.
5+
Follow the steps below to deploy a DNS server into a console application :
6+
7+
1) Create an empty Console application.
8+
9+
2) Install the Nuget package **DnsServer**.
10+
11+
3) In the Program.cs file, insert the following code into the **Main** method.
12+
13+
4) Configure the network interface to use the local DNS server.
14+
15+
5) Open a command prompt and execute **ping www.example.com**.
16+
17+
::
18+
19+
var dnsServer = new DnsServerHostBuilder(o =>
20+
{
21+
o.ExcludeForwardRequests.Add(new Regex("^.*example\\.com$"));
22+
o.ExcludeForwardRequests.Add(new Regex("^.*in-addr\\.arpa$"));
23+
})
24+
.AddDNSZones(new List<DNSZone>
25+
{
26+
new DNSZone("example.com")
27+
{
28+
ResourceRecords = new List<ResourceRecord>
29+
{
30+
new AResourceRecord(3600)
31+
{
32+
Address = "127.0.0.1"
33+
},
34+
new AResourceRecord(3600, "www")
35+
{
36+
Address = "127.0.0.1"
37+
},
38+
new AResourceRecord(3600, "ns1")
39+
{
40+
Address = "127.0.0.1"
41+
},
42+
new SOAResourceRecord(3600)
43+
{
44+
MName = "ns1.example.com",
45+
RName = "admin.example.com",
46+
Serial = 5,
47+
Refresh = 604800,
48+
Expire = 2419200,
49+
Minimum = 604800,
50+
Retry = 86400
51+
},
52+
new NSResourceRecord(3600)
53+
{
54+
NSDName = "ns1.example.com"
55+
}
56+
}
57+
},
58+
new DNSZone("1.0.0.127.in-addr.arpa")
59+
{
60+
ResourceRecords = new List<ResourceRecord>
61+
{
62+
new PTRResourceRecord(100)
63+
{
64+
PTRDNAME = "localhost"
65+
}
66+
}
67+
}
68+
})
69+
.AddDNSRootServers(DnsServerConstants.DefaultRootServers)
70+
.Build();
71+
dnsServer.Run();
72+
73+
The **DnsServerHostBuilder** class accepts in its constructor a callback which can be used by developers to change the options of the DNS server.
74+
There are several operations exposed by the **DnsServerHostBuilder** class :
75+
76+
- **AddDNSZones** : Configure DNS zones.
77+
78+
- **AddDNSRootServers** : Configure the DNS root servers.
79+
80+
A WPF client also exists `here`_.
81+
82+
.. _here: https://github.com/simpleidserver/DnsServer/tree/master/src/DnsServer.WpfClient

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)