File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11using System . Collections . Concurrent ;
22using bet_blocker . Business . Interfaces ;
33using Infrastructure . Services . Interfaces ;
4- using static bet_blocker . DTOs . ResponseHostDto ;
54using System . Text . Json ;
5+ using static bet_blocker . DTOs . ResponseHostDto ;
6+ using System . Net ;
7+ using bet_blocker . DTOs ;
68
79namespace bet_blocker . Business
810{
@@ -120,20 +122,21 @@ private static async Task<ResponseHostsDTO> ResolveDomainInfo(string domain)
120122 {
121123 var hostEntry = await System . Net . Dns . GetHostEntryAsync ( domain ) ;
122124 var ipAddress = hostEntry . AddressList . FirstOrDefault ( ) ? . ToString ( ) ;
125+ IPAddress ip = IPAddress . Parse ( ipAddress ?? "" ) ;
123126
124127 responseHost . Ips = new Ips
125128 {
126129 Ip = ipAddress ,
127130 ResolvedAt = DateTime . UtcNow
128131 } ;
129132
130- responseHost . DNS = new Dns
133+ responseHost . DNS = new ResponseHostDto . Dns
131134 {
132135 Type = hostEntry . AddressList . FirstOrDefault ( ) ? . AddressFamily . ToString ( ) ,
133136 Name = hostEntry . HostName ,
134137 Host = domain ,
135138 CanonicalName = hostEntry . HostName ,
136- ReverseDns = ipAddress ,
139+ ReverseDns = System . Net . Dns . GetHostEntryAsync ( ip ) . Result . HostName ,
137140 TTl = "3600" ,
138141 ResolvedAt = DateTime . UtcNow
139142 } ;
You can’t perform that action at this time.
0 commit comments