Click here to Skip to main content
15,884,836 members
Articles / Programming Languages / C#

DNS.NET Resolver (C#)

Rate me:
Please Sign up or sign in to vote.
4.99/5 (96 votes)
11 Mar 2013CPOL6 min read 646K   18.6K   280  
A full implementation of a reusable DNS resolver component and a Dig.Net example application.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B1EACF94-22A9-4C47-9BE5-33332E39E07B}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>DnsDig</RootNamespace>
    <AssemblyName>DnsDig</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
    <Reference Include="System" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AboutForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="AboutForm.Designer.cs">
      <DependentUpon>AboutForm.cs</DependentUpon>
    </Compile>
    <Compile Include="Examples.cs" />
    <Compile Include="Feedback.cs" />
    <Compile Include="Dns\Header.cs" />
    <Compile Include="Dns\Question.cs" />
    <Compile Include="Dns\Records\RecordAAAA.cs" />
    <Compile Include="Dns\Records\RecordMD.cs" />
    <Compile Include="Dns\Records\RecordMF.cs" />
    <Compile Include="Dns\Records\RecordMB.cs" />
    <Compile Include="Dns\Records\RecordMG.cs" />
    <Compile Include="Dns\Records\RecordMR.cs" />
    <Compile Include="Dns\Records\RecordNULL.cs" />
    <Compile Include="Dns\Records\RecordWKS.cs" />
    <Compile Include="Dns\Records\RecordTXT.cs" />
    <Compile Include="Dns\Records\RecordMINFO.cs" />
    <Compile Include="Dns\Records\RecordHINFO.cs" />
    <Compile Include="Dns\Records\RecordPTR.cs" />
    <Compile Include="Dns\Records\RecordCNAME.cs" />
    <Compile Include="Dns\Records\RecordNS.cs" />
    <Compile Include="Dig.cs" />
    <Compile Include="Dns\Records\RecordA.cs" />
    <Compile Include="Dns\Records\Record.cs" />
    <Compile Include="Dns\Request.cs" />
    <Compile Include="Dns\Response.cs" />
    <Compile Include="Dns\RR.cs" />
    <Compile Include="Dns\Records\RecordReader.cs" />
    <Compile Include="Dns\Resolver.cs" />
    <Compile Include="MainForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="MainForm.Designer.cs">
      <DependentUpon>MainForm.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="AboutForm.resx">
      <DependentUpon>AboutForm.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="MainForm.resx">
      <SubType>Designer</SubType>
      <DependentUpon>MainForm.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
      <DesignTime>True</DesignTime>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="Dns\Records\RecordMX.cs" />
    <Compile Include="Dns\Records\RecordUnknown.cs" />
    <Compile Include="Dns\Records\RecordSOA.cs" />
    <Compile Include="Dns\Structs.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Doc\rfc1034.txt" />
    <None Include="Doc\rfc1035.txt" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Doc\rfc1886.txt" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Retired Van der Heijden Holding BV
Netherlands Netherlands
I'm Alphons van der Heijden, living in Lelystad, Netherlands, Europa, Earth. And currently I'm retiring from hard working ( ;- ), owning my own company. Because I'm full of energy, and a little to young to relax ...., I don't sit down, but create and recreate software solutions, that I like. Reinventing the wheel is my second nature. My interest is in the area of Internet technologies, .NET etc. I was there in 1992 when Mosaic came out, and from that point, my life changed dramatically, and so did the world, in fact. (Y)

Comments and Discussions