Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Recent Changes
* When logging status changes to a text file, aliases are now included.
* Lots of minor visual changes:
- On status change alerts, the text for _DOWN_ and _UP_ is now all lowercase _down_ and _up_.
- On popup alerts, an arrow symbol replaces the word "is". For example _127.0.0.1 is down_ becomes _127.0.0.1 🠖 down_
- On popup alerts, an arrow symbol replaces the word "is". For example _127.0.0.1 is down_ becomes _127.0.0.1 🠖 down_
- All references to Popup Notifications have been renamed to Popup Alerts (to be consistent with email alerts and audio alerts).
- Custom styling on the main dropdown menu. Added icons to most menu items.
- Minor style changes and icons added to the alias and favorites windows.
Expand Down Expand Up @@ -175,7 +175,7 @@ Features
* Favorites. Easily save a collections of hosts to be recalled instantly at a later time.
* Aliases. You can assign a friendly display name for any given host.
* Traceroute. For the hostname, enter _T/HOSTNAME_ to perform a traceroute.
* DNS forward and reverse lookups. For the hostname, enter _D/NAME_OR_IP_ to perform a DNS lookup.
* DNS forward and reverse lookups with detailed record data (A/AAAA/CNAME/MX/TXT/NS/SOA) and multi-resolver propagation checks. Use the DNS Lookup menu (Ctrl-D) or enter _D/NAME_OR_IP_ in a probe to run a lookup.
* Specify any number of hosts from the command line to instantly begin pinging when the application opens.
* Specify a file containing a list of hosts to load and instantly ping when the application launches.
* Command line usage:
Expand Down
871 changes: 871 additions & 0 deletions vmPing/Classes/DnsLookupService.cs

Large diffs are not rendered by default.

41 changes: 18 additions & 23 deletions vmPing/Classes/Probe-Dns.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System;
using System.Collections.ObjectModel;
using System.Net;
using System.Threading;

namespace vmPing.Classes
Expand All @@ -15,36 +14,32 @@ private async void PerformDnsLookup(CancellationToken cancellationToken)

try
{
AddHistory($"[\u2022] Resolving {Hostname}:{Environment.NewLine}");
switch (Uri.CheckHostName(Hostname))
var lines = await DnsLookupService.LookupAndFormatAsync(Hostname, cancellationToken);

foreach (var line in lines)
{
case UriHostNameType.IPv4:
case UriHostNameType.IPv6:
var host = await Dns.GetHostEntryAsync(Hostname);
cancellationToken.ThrowIfCancellationRequested();
if (host != null)
AddHistory($" {host.HostName}");
break;
case UriHostNameType.Dns:
var ipAddresses = await Dns.GetHostAddressesAsync(Hostname);
cancellationToken.ThrowIfCancellationRequested();
foreach (var ip in ipAddresses)
AddHistory($" {ip}");
break;
default:
throw new Exception();
cancellationToken.ThrowIfCancellationRequested();
AddHistory(line);
}
AddHistory($"{Environment.NewLine}{Environment.NewLine}\u2605 Done");

AddHistory(string.Empty);
AddHistory("\u2605 Done");
}
catch (OperationCanceledException)
{
}
catch
catch (Exception ex)
{
if (!cancellationToken.IsCancellationRequested)
AddHistory($"{Environment.NewLine}\u2605 Unable to resolve hostname");
{
AddHistory(string.Empty);
AddHistory($"\u2605 DNS lookup failed: {ex.Message}");
}
}
finally
{
IsActive = false;
}
}
}
}
}
9 changes: 9 additions & 0 deletions vmPing/Properties/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion vmPing/Properties/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@
<data name="Menu_StatusHistory" xml:space="preserve">
<value>Status History</value>
</data>
<data name="Menu_DnsLookup" xml:space="preserve">
<value>DNS Lookup</value>
</data>
<data name="Menu_Traceroute" xml:space="preserve">
<value>Traceroute</value>
</data>
Expand Down Expand Up @@ -411,4 +414,4 @@
<data name="Tooltip_IsolatedView" xml:space="preserve">
<value>Open isolated view</value>
</data>
</root>
</root>
49 changes: 48 additions & 1 deletion vmPing/ResourceDictionaries/Icons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,53 @@

<!-- Icon: route -->
<!-- Credit: Ryan Smith -->
<DrawingImage x:Key="icon.dns">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V128 H128 V0 H0 Z">
<GeometryDrawing Brush="#1ba1e2">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="64,64" RadiusX="28" RadiusY="28" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="#123456" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<EllipseGeometry Center="64,64" RadiusX="36" RadiusY="36" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#123456">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="64,24" RadiusX="10" RadiusY="10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#123456">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="24,88" RadiusX="10" RadiusY="10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#123456">
<GeometryDrawing.Geometry>
<EllipseGeometry Center="104,88" RadiusX="10" RadiusY="10" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="#1ba1e2" Thickness="6" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="64,40" EndPoint="64,34" />
<LineGeometry StartPoint="44,74" EndPoint="34,78" />
<LineGeometry StartPoint="84,74" EndPoint="94,78" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>

<DrawingImage x:Key="icon.route">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
Expand Down Expand Up @@ -391,4 +438,4 @@
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
</ResourceDictionary>
81 changes: 81 additions & 0 deletions vmPing/Views/DnsLookupWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<Window x:Class="vmPing.Views.DnsLookupWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="vmPing - DNS Lookup"
Height="520"
Width="640"
ResizeMode="CanResize"
Background="#002b36"
Loaded="Window_Loaded">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<TextBlock Text="Hostname" VerticalAlignment="Center" Foreground="White"/>
<TextBox x:Name="HostnameTextBox"
Grid.Column="1"
Height="32"
FontSize="16"
VerticalContentAlignment="Center"
Margin="0,0,8,0"/>
<Button x:Name="LookupButton"
Grid.Column="2"
Padding="16,6"
Content="Lookup"
Click="LookupButton_Click"/>
</Grid>

<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock x:Name="StatusText" Foreground="#ffd27f" FontSize="13"/>
</StackPanel>

<Border Grid.Row="2" Margin="0,12,0,12" BorderBrush="#114b5f" BorderThickness="1" Background="#001a21">
<TextBox x:Name="ResultsTextBox"
Background="#001a21"
Foreground="#cceeff"
BorderThickness="0"
IsReadOnly="True"
TextWrapping="Wrap"
AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled"
FontFamily="Consolas"
FontSize="13"/>
</Border>

<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="CancelButton"
Content="Cancel"
Padding="16,6"
Visibility="Collapsed"
Click="CancelButton_Click"/>
<Button x:Name="CopyButton"
Content="Copy Results"
Padding="16,6"
Click="CopyButton_Click"/>
<Button x:Name="AddProbeButton"
Content="Add to Probes"
Padding="16,6"
Click="AddProbeButton_Click"/>
<Button Content="Close"
Padding="16,6"
IsCancel="True"
Click="CloseButton_Click"/>
</StackPanel>
</Grid>
</Window>




Loading
Loading