I own a domain lets call it wholesale.com, what I would like to do is set it so that any email sent to @wholesale.com will be received in my gmail.com email account. I believe this can be done by changing the DNS records. However I am uncertain which records to change and in which way. Would someone please lay this out for me, preferably with an explanation for each setting. I would really like to understand the why as well as the how.
The DNS record type used to manage email is called MX. These records tell an SMTP server where to send an email message.
However, the server listed in this MX record needs to be configured to expect and receive these messages. The server can be configured to accept a message as the final destination, or to serve as an intermediate hop and relay the message elsewhere. Admins must be careful not to create an open relay or else their system will be abused by spammers. Many rules can be configured on the receiving server including only accepting messages from authenticated accounts, for valid users, for specified domains, and many more. These rules will keep your messages sent to @YOUR_DOMAIN.com from being received by Gmail's system, since Google is not configured to host email for YOUR_DOMAIN.com even if you setup the MX records.
The other issue is how would Gmail know that emails sent to any address @YOUR_DOMAIN.com should be delivered to your gmail.com address? There needs to be a way to map a list of email addresses to a destination mailbox. This is called aliasing.
To get what you want, you would need to setup an SMTP server or utilize a service that could provide this aliasing and forward your messages to a single gmail.com address. Then you would setup your MX records to point to the SMTP server you configured.