I'm exchanging emails with a number of different users - is it possible to look at the mail headers and figure out if those users are using Google Apps as the mail server?


Dig their MX records:

$> dig domainname.com mx

If they're with Google, you'll know it.

domainname.com.            2198    IN      MX      10 ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      20 ALT1.ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      20 ALT2.ASPMX.L.GOOGLE.com.
domainname.com.            2198    IN      MX      30 ASPMX2.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX3.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX4.GOOGLEMAIL.com.
domainname.com.            2198    IN      MX      30 ASPMX5.GOOGLEMAIL.com.
  • 1
    For windows see members.shaw.ca/nicholas.fong/dig – harrymc Nov 5 '10 at 15:30
  • 1
    Also you could use samspade.org. – CarlF Nov 5 '10 at 15:33
  • 2
    striking out a bit from Piskor's comment, google.com/a/example.com/ServiceLogin?service=mail with the correct domain will show you a login page and explain how to login IF example.com is a valid google apps domain. (I just tested it) – PsychoData Aug 11 '14 at 18:29
  • Is there a way to identify through HTTP request ? – Vali Shah Nov 22 '17 at 4:50
  • @ValiShah yes! you could use a public internet service to check the DNS MX records for you. try this: curl 'https://dns.google.com/resolve?name=google.com&type=MX'. or just visit dns.google.com and use the web interface. – zfogg Jun 14 '20 at 23:38

I think easiest would be just to type it into Google Domain Tester. It does the work for you.



  • 1
    Technically, the answer is the link. That said, if the link went down it would be doubly useless. – Journeyman Geek Jan 7 '17 at 4:38
  • Tested: seems not working. (tested with a known g-suite enabled email) – Offirmo Jul 17 '18 at 1:21

If you are using .NET, and make the assumption that their domain is MAIL.theirdomain.com, you can do this:


Google Apps accounts that I've seen all end with google.com, such as ghs.google.com.


  • Writing a program to perform a DNS query with tons of existing tools seems like an overkill... – Matteo Apr 15 '12 at 15:26
  • @Matteo this could be used in PowerShell, which comes with Windows Vista and newer... – Bob Apr 15 '12 at 15:50
  • 3
    That might appear to work, kind of - except when it won't. Many domains have a 3rd-level wildcard for A records - mail.example.com would point to the same host as xyzzy.example.com and foobar.example.com. It is better to check the actual MX record (see the accepted answer) than to guess. On half the domains I've set up with Google Apps, your method would mistakenly return "false", as the web access was not on mail.example.org. For example, this is a valid way to login: google.com/a/example.com/ServiceLogin?service=mail – Piskvor left the building Apr 15 '12 at 16:04
  • or, for that matter, you can log in at mail.google.com as long as you provide your entire organizations email address eg 'helpdesk@students.abtex.edu'. Just to be fair to piskvor, I don't think this method was valid in 2012. – PsychoData Aug 11 '14 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.