Resolving IP address from Domain address

Posted on 2001-06-21
Medium Priority
Last Modified: 2010-04-21
I want to resolve IP address from the domain address when a user trying to login into a remote Mail server using my IMAP based mailclient.
MY IMAP based mail client will get the login ID of the user in the format username@mailserver.com. From this i have to seperate the domain address and i have to resolve that domain name into an IP address. how can i achieve this in my C-CGI programe which runs under LINUX.
Question by:sunsrigod
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6216679
have a look at gethostbyname.

Accepted Solution

bryanh earned 20 total points
ID: 6221611
But be aware that mailserver.com doesn't necessarily have an IP address.  Without knowing the specifics of the interface to your mail client, I don't know exactly what "username@mailserver.com" means, but it's probably just an email address, which means it's likely that "mailserver.com" is a mail exchange (MX) domain, which means it is not associated with an IP address.  And if it _is_ a host name (which means it _is_ associated with an IP address), it isn't necessarily the host that sent the email in question.
LVL 20

Expert Comment

ID: 9868867
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: bryanh {http:#6221611}

Please leave any comments here within the next seven days.

EE Cleanup Volunteer

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question