problem wtih sendmail, DHCP and fully qualified domain names - Solaris

This is a discussion on problem wtih sendmail, DHCP and fully qualified domain names - Solaris ; Hi all, I have Solaris 10 running in a VMWare 5.5. virtual machine. There is no name server in my configuration, no DNS, only a DHCP server as part of the VMWare network config that assigns ip addresses only not ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: problem wtih sendmail, DHCP and fully qualified domain names

  1. problem wtih sendmail, DHCP and fully qualified domain names

    Hi all,

    I have Solaris 10 running in a VMWare 5.5. virtual machine. There is no
    name server in my configuration, no DNS, only a DHCP server as part of
    the VMWare network config that assigns ip addresses only not hostnames
    as well. I'm using this machine to develop and test a J2EE application
    running on WebLogic 9.

    I'm having a somewhat irritating problem with sendmail displaying a
    message every 5-10 minutes saying;

    "unable to qualify my own domain name (sol10cm) -- using shortname"

    The domain name I've configured in defaultdomain is;

    "eistream.net"

    I've also configured the FQDN in
    /etc/hosts
    /etc/mail/local-host-names
    /etc/inet/ipnodes

    Problem is whenever I reboot the system the FQDN in hosts keeps getting
    overwritten by DHCP causing sendmail to fail.

    Before rebooting, the hosts file would look like;

    127.0.0.1 localhost loghost
    x.x.x.x sol10cm.eistream.net sol10cm

    After a reboot, the hosts file looks like;

    127.0.0.1 localhost loghost
    x.x.x.x sol10cm # Automatically added by DHCP

    How do I stop DHCP from automatically updating the hostname? I'm aware
    that stopping the sendmail service is one option, however I don't want
    to do that as I may need to integrate my application with an email
    server at some point in the future.

    --
    Regards,

    JasonB

  2. Re: problem wtih sendmail, DHCP and fully qualified domain names

    > Problem is whenever I reboot the system the FQDN in hosts keeps
    > getting overwritten by DHCP causing sendmail to fail.
    > How do I stop DHCP from automatically updating the hostname?


    Well, that's easy. The process is spelled out here:

    http://opensolaris.org/os/community/...ris_DHCP_setup

    with the exception that the procedure noted there for modifying the
    net-svc script needs to be modified slightly. (I'm working to get
    that page updated with the corrections below, which should happen
    shortly.) Here is a paragraph that belongs before the diff listing:

    The net-svc script is used to start the svc:/network/service
    service at boot time. If you ever want to modify one of the
    existing service startup scripts, as in the present case, do not
    edit the ones Sun ships. Make a copy, edit it as much as you
    need, then modify the start/exec property of the associated
    service to point to your changed copy. That way, your changes
    won't be overwritten should you install a patch Sun supplies or
    upgrade to a newer version of the OS.

    To that end, we first show the changes in the modified
    (net-svc.local) script:

    # cd /lib/svc/method
    # diff -c net-svc net-svc.local
    *** net-svc Fri Jan 21 15:38:22 2005
    --- net-svc.local Sun Jun 12 16:56:06 2005

    and here is text that belongs right after that listing:

    And then we show how to configure the machine to use the
    modified script:

    # svccfg -v -s svc:/network/service setprop start/exec = \
    astring: '("/lib/svc/method/net-svc.local start")'
    # svcadm refresh network/service


  3. Re: problem wtih sendmail, DHCP and fully qualified domain names

    Glenn wrote:
    >> Problem is whenever I reboot the system the FQDN in hosts keeps
    >> getting overwritten by DHCP causing sendmail to fail.
    >> How do I stop DHCP from automatically updating the hostname?

    >
    > Well, that's easy. The process is spelled out here:
    >
    > http://opensolaris.org/os/community/...ris_DHCP_setup
    >
    > with the exception that the procedure noted there for modifying the
    > net-svc script needs to be modified slightly. (I'm working to get
    > that page updated with the corrections below, which should happen
    > shortly.) Here is a paragraph that belongs before the diff listing:
    >
    > The net-svc script is used to start the svc:/network/service
    > service at boot time. If you ever want to modify one of the
    > existing service startup scripts, as in the present case, do not
    > edit the ones Sun ships. Make a copy, edit it as much as you
    > need, then modify the start/exec property of the associated
    > service to point to your changed copy. That way, your changes
    > won't be overwritten should you install a patch Sun supplies or
    > upgrade to a newer version of the OS.
    >
    > To that end, we first show the changes in the modified
    > (net-svc.local) script:
    >
    > # cd /lib/svc/method
    > # diff -c net-svc net-svc.local
    > *** net-svc Fri Jan 21 15:38:22 2005
    > --- net-svc.local Sun Jun 12 16:56:06 2005
    >
    > and here is text that belongs right after that listing:
    >
    > And then we show how to configure the machine to use the
    > modified script:
    >
    > # svccfg -v -s svc:/network/service setprop start/exec = \
    > astring: '("/lib/svc/method/net-svc.local start")'
    > # svcadm refresh network/service
    >


    Cheers for the information, that's resolved the issue completely.

    --
    Regards,

    JasonB

  4. Re: problem wtih sendmail, DHCP and fully qualified domain names

    > Well, that's easy. The process is spelled out here:

    HUH ?

    > with the exception that the procedure noted there for modifying the
    > net-svc script needs to be modified slightly. (I'm working to get


    Sorry but I really think you have no idea how things work.

    "programs also need access to the FQHN. Fixing this automatically at boot time
    required a modification to the net-svc script, to include the FQHN on the same
    line as the bare hostname:"


    Why on earth mess with system scripts if the only thing you need to do is edit
    /etc/default/dhcpagent and then simply tell it *not* to pick up the hostname
    from the DHCP server (REQUEST_HOSTNAME = no) ?

    As documented in the dhcp(5) manualpage.

    --
    Groetjes, Peter

    ..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc

  5. Re: problem wtih sendmail, DHCP and fully qualified domain names

    > Problem is whenever I reboot the system the FQDN in hosts keeps getting
    > overwritten by DHCP causing sendmail to fail.
    >
    > How do I stop DHCP from automatically updating the hostname?


    Very simple, as described in the dhcp(5) manualpage all you need to do is edit
    /etc/default/dhcpagent. If you wish to stop this for all interfaces you just
    comment out "REQUEST_HOSTNAME=no" to make this work. If you wish to set this up
    for a specific interface only you need to prepend the interface name to this
    statement, as described in the file itself. For example
    "hme0.REQUEST_HOSTNAME=no".

    And finally, if you wish to specificly define what the DHCP agent should and
    shouldn't pick up (also configurable for each interface seperatly) you can do
    so using the "PARAM_REQUEST_LIST".


    Whatever you do, I *strongly* suggest you do not edit system method scripts to
    accomplish this. Not only is this very bad practice, it will risk your box
    becoming unstable the moment Sun updates those scripts (resulting in them being
    overwritten) after which your system falls back to the current situation.

    Whoever claims that you need to edit or patch system startup scripts to
    accomplish this obviously has no idea what he's doing.


    --
    Groetjes, Peter

    ..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc

  6. Re: problem wtih sendmail, DHCP and fully qualified domain names

    Lion-O wrote:
    >> Problem is whenever I reboot the system the FQDN in hosts keeps getting
    >> overwritten by DHCP causing sendmail to fail.
    >>
    >> How do I stop DHCP from automatically updating the hostname?

    >
    > Very simple, as described in the dhcp(5) manualpage all you need to do is edit
    > /etc/default/dhcpagent. If you wish to stop this for all interfaces you just
    > comment out "REQUEST_HOSTNAME=no" to make this work. If you wish to set this up
    > for a specific interface only you need to prepend the interface name to this
    > statement, as described in the file itself. For example
    > "hme0.REQUEST_HOSTNAME=no".
    >
    > And finally, if you wish to specificly define what the DHCP agent should and
    > shouldn't pick up (also configurable for each interface seperatly) you can do
    > so using the "PARAM_REQUEST_LIST".
    >
    >
    > Whatever you do, I *strongly* suggest you do not edit system method scripts to
    > accomplish this. Not only is this very bad practice, it will risk your box
    > becoming unstable the moment Sun updates those scripts (resulting in them being
    > overwritten) after which your system falls back to the current situation.
    >
    > Whoever claims that you need to edit or patch system startup scripts to
    > accomplish this obviously has no idea what he's doing.
    >
    >


    Ok, thanks for the update on this, I'll have another look at this later
    on today and re-work the changes made based on your recommendations above.

    For what it's worth, the server I'm using is a VMWare Image used for
    demonstration purposes only, not an actual physical production box.
    That said, I also understand that it's better to get into the habit of
    using best practice, even in a virtual machine environment.

    --
    Regards,

    JasonB

+ Reply to Thread