I am working on a c# console application, and inside my console application, i have the following code, to get the IP for a website:-
using System.Net
using System.Web;
using System.IO;
namespace MyConsoleApp
{
class Program
{
static async Task Main(string[] args)
{
IPHostEntry hosten = Dns.GetHostEntry("www." + website);
if (hosten.AddressList.Count() >= 1)
{
string ip = hosten.AddressList[0].ToString();
but the IP i will get for the website will be different compared to the IP i will get from some online IP checker sites such as https://www.site24x7.com/find-ip-address-of-web-site.html.. so is using System.Net.Dns.GetHostEntry()
a trusted appraoch to know the IP address for a web site? if the answer is yes then why i am getting different IP from online IP checker sites?