Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 10 down vote accepted

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.
share|improve this answer
For windows see members.shaw.ca/nicholas.fong/dig –  harrymc Nov 5 '10 at 15:30
Thanks, @harrymc. –  user3463 Nov 5 '10 at 15:30
Also you could use samspade.org. –  CarlF Nov 5 '10 at 15:33
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

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.


share|improve this answer
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
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 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 posting your answer, you agree to the privacy policy and terms of service.

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