Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

finding which provider is responsible for the mail domain

Tags:

node.js

dns

By provider, I mean the provider responsible for mail, e.g. for gmail the provider would be gmail(or/by google) and for microsoft.com it would be outlook(by microsoft).

Basically, I want to find out given an email domain e.g. [email protected], [email protected] is from a specific provider(outlook or gmail) in our case, since xyz or tuv is not explicitly evident which provider it belongs to.

I have succeded somewhat, my idea being to make use of MX records, so I do something like this in nodejs:

const dnsMod = require('dns');

dnsMod.resolveMx(
    'mydomain.com', (err, value)=>{
        console.log('The error is : ', err);
        console.log('The value is : ', value);
    }
)  

and it returns records like this:

[
  { exchange: 'alt3.gmail-smtp-in.l.google.com', priority: 30 },
  { exchange: 'alt1.gmail-smtp-in.l.google.com', priority: 10 },
  { exchange: 'gmail-smtp-in.l.google.com', priority: 5 },
  { exchange: 'alt2.gmail-smtp-in.l.google.com', priority: 20 },
  { exchange: 'alt4.gmail-smtp-in.l.google.com', priority: 40 }
]   

so, seeing this we can conclude the provider in this case is infact gmail.

But, my point is, is it safe to conclude the provider is gmail just it contains words like google, gmail etc. In other words, do google's mail servers always have a google.com in the end, (or Similarly, microsoft's mail provider have outlook.com or microsoft.com in the end)? If not, what better way would be to confirm this?

EDIT: As per suggested by comment, I need the information because, based on the information I need to show only one of google or outlook button.

like image 537
BumbleBee Avatar asked Jun 22 '21 15:06

BumbleBee


People also ask

What is my email domain?

To put it simply, the part of your email address behind the @ symbol – in other words, @mail.com, @email.com, @usa.com – is called a domain. It functions like a virtual street name that lets your email get delivered to the right address. Each email domain is associated with a specific mail server or servers.

Who is the email provider for Gmail?

Gmail is a free email service provided by Google. As of 2019, it had 1.5 billion active users worldwide.

Which type of record is used to find out mail server in the network?

DNS uses two kinds of records: Mail Exchanger (MX) records and A records. An MX record maps a domain name to the names of one or more mail hosts. An A record maps a host name to the IP address of a server. Mail servers also use other DNS records.


1 Answers

For getting the information who is the responsible for the mail domain do a whois query by your prefered whois query service, pe. by https://who.is

like image 184
Eddy763 Avatar answered Nov 15 '22 03:11

Eddy763