Solved

Setting up sendmail with dynamic dns

Posted on 2001-07-06
5
209 Views
Last Modified: 2010-03-18
I have a system running RedHat 7.1, connected to the net over a Time-Warner cable modem.  I get my IP address from TW's dhcp server, and it sometimes changes when I have to reboot.  I am using dyndns.org and one of their little update clients to map the domain foobar.homeip.net (not the actual domain) to whatever actual ip address I have at the moment, and this works quite well.  I can use ssh and sftp to get into my system remotely via this domain name.

I would like to be able to send mail to a personal account on this machine as well, but so far, I can't figure out how to set it up.  I presume that I need to store the domain name somewhere on the local machine (/etc/hosts? /etc/defaultdomain? /etc/HOSTNAME?)  I also need to set up sendmail.cf so it knows who it is and where to put incoming mail.  All of the documentation I have seen so far assumes that you have a fixed ip address. Is there a step-by step guide somewhere to setting up this kind of a configuration, or can someone spell it out for me here?

Thanks

JEH
0
Comment
Question by:harlow
5 Comments
 
LVL 1

Expert Comment

by:sergeis
ID: 6261357
If you use this machine solely as a server, then I suggest yanking RH 7.1 and installing e-smith Linux. Has all you need by default, works well with dynamic DNS and ridiculously easy to configure via web, telnet or console. It uses qmail, not sendmail, by default, which more secure and easier to configure.

On the other hand, if this is a workstation... Sorry. Otta be a way... Search google for "dynamic dns sendmail configuration".
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6261466
if you're new to sendmail it's best you get the O'Relly's Sendmail book (that with the bat on it). sendmail, even if you have read the book twice, is hard stuff. For newbies, especially on Linux, I recommend using postfix (probably qmail), 'cause it is much simpler to setup.
0
 
LVL 3

Expert Comment

by:tdaoud
ID: 6263606

I think what you are trying to do is not simple because to send mail to your computer (by name), you must have a name, somebody must resolve this name to IP address and also assign a mail server for that name.

Now you need to resolve the following

1) What is the name of your domain/Machine?
2) Who is supposed to resolve your name to ip addresses?
3) Are they willing to dynamically assign and change mail servers for you and deliver it to you?
4) DNS changes if involved will always take several hours to be propagated accross the net.

Good Luck,

Tarik
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 6266335
I think this can be made to work provided that two conditions are met before sendmail is started. The first is that the output of "hostname" must be that of the FQDN for your domain (you do have a registered domain name, right?) as registered for your IP at dydns. The second is that that the host record in /etc/hosts must reflect the current IP.

The hostname condition can be fixed in /etc/sysconfig/netowrk, or if DHCP insists on setting it each time you can easily override that with a "hostname my-sys.my-domain.tld". Fixing the hosts file record could be done with a shell or perl script. The following commands will build a valid hosts file:

# IP=`/sbin/ifconfig eth0|sed -ne 's/.*inet addr:\([0-9\.]*\) .*/\1/p'`
# echo -e "127.0.0.1\tlocalhost.localdomain localhost" >/etc/hosts
# echo -e "$IP\tmy-sys.my-domain.tld my-sys" >>/etc/hosts

The only problem that I see with doing this is how to handle a change in IP while the system is running. If that were to happen you'll need to kill sendmail, execute the above, and restart sendmail.
0
 

Author Comment

by:harlow
ID: 6337186
Thanks.  I think I am convinced that this is too much trouble to waste my time on!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now