[gentoo-user] Use of gethostname() and getdomainname()

2007-11-30 Thread Kevin O'Gorman
I've got my own domain and domain server.  I've just run into a problem
about the appropriate settings for hosts and domains, and it's messing up a
few things in my postfix setup.

The gentoo instructions say to set /etc/conf.d/hostname to the host name
only.  It gets passed to sethostname(2) unchanged by /etc/init.d/hostname.
I did it.
The gentoo instructions say to put a domain name, if needed, into
/etc/conf.d/net.  It seems to get used in network setup.  I did it.

Nothing seems to be set into whatever it is that setdomainname(2) is used
for.
My mailx mailer seems to put "localdomain" on the sender address when my
crontab entries call it.  Maybe because it sees that getdomainname(2) comes
up empty.

What's the right way to set this up?  Should I just cobble my proper domain
into setdomainname(2)?  Is there a right way?  Is there a better way?

-- 
Kevin O'Gorman, PhD


Re: [gentoo-user] Use of gethostname() and getdomainname()

2007-12-01 Thread Stroller


On 1 Dec 2007, at 06:26, Kevin O'Gorman wrote:


... my postfix setup.
...
My mailx mailer seems to put "localdomain" on the sender address  
when my crontab entries call it.  Maybe because it sees that  
getdomainname(2) comes up empty.


Hi there,

I have encountered similar problems.

I don't use mailx, but just this instead:
  for foo in `seq 10` ; do echo "Subject: test $foo of 10" |  /usr/ 
sbin/sendmail [EMAIL PROTECTED] ; done


I was getting localdomain as part of the address, also, and  
consequent mailbounce. I had to set "myhostname = " in /etc/postfix/ 
main.cf in order to overcome this, and find the necessity annoying.


What's the right way to set this up?  Should I just cobble my  
proper domain into setdomainname(2)?  Is there a right way?  Is  
there a better way?


I see you don't have any other replies here, so I'd be grateful if  
you could please keep us (well, me) posted if you experiment further  
or look for advice elsewhere.


Stroller.

--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Use of gethostname() and getdomainname()

2007-12-01 Thread Etaoin Shrdlu
On Saturday 1 December 2007, Kevin O'Gorman wrote:

> I've got my own domain and domain server.  I've just run into a
> problem about the appropriate settings for hosts and domains, and it's
> messing up a few things in my postfix setup.
>
> The gentoo instructions say to set /etc/conf.d/hostname to the host
> name only.  It gets passed to sethostname(2) unchanged by
> /etc/init.d/hostname. I did it.
> The gentoo instructions say to put a domain name, if needed, into
> /etc/conf.d/net.  It seems to get used in network setup.  I did it.
>
> Nothing seems to be set into whatever it is that setdomainname(2) is
> used for.
> My mailx mailer seems to put "localdomain" on the sender address when
> my crontab entries call it.  Maybe because it sees that
> getdomainname(2) comes up empty.
>
> What's the right way to set this up?  Should I just cobble my proper
> domain into setdomainname(2)?  Is there a right way?  Is there a
> better way?

Try adding the following line to /etc/hosts:

a.b.c.d  hostname.your.domain  hostname

of course, replacing a.b.c.d with your correct ip address.

I don't know whether this is related to your problem, but it usually 
solves the domainname: (none) problem. 
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Use of gethostname() and getdomainname()

2007-12-02 Thread Mick
On Saturday 01 December 2007, Etaoin Shrdlu wrote:
> On Saturday 1 December 2007, Kevin O'Gorman wrote:
> > I've got my own domain and domain server.  I've just run into a
> > problem about the appropriate settings for hosts and domains, and it's
> > messing up a few things in my postfix setup.
> >
> > The gentoo instructions say to set /etc/conf.d/hostname to the host
> > name only.  It gets passed to sethostname(2) unchanged by
> > /etc/init.d/hostname. I did it.
> > The gentoo instructions say to put a domain name, if needed, into
> > /etc/conf.d/net.  It seems to get used in network setup.  I did it.
> >
> > Nothing seems to be set into whatever it is that setdomainname(2) is
> > used for.
> > My mailx mailer seems to put "localdomain" on the sender address when
> > my crontab entries call it.  Maybe because it sees that
> > getdomainname(2) comes up empty.
> >
> > What's the right way to set this up?  Should I just cobble my proper
> > domain into setdomainname(2)?  Is there a right way?  Is there a
> > better way?
>
> Try adding the following line to /etc/hosts:
>
> a.b.c.d  hostname.your.domain  hostname
>
> of course, replacing a.b.c.d with your correct ip address.
>
> I don't know whether this is related to your problem, but it usually
> solves the domainname: (none) problem.

Is this meant to be the LAN private address, or the Internet address of the 
host?

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Use of gethostname() and getdomainname()

2007-12-02 Thread Etaoin Shrdlu
On Sunday 2 December 2007, Mick wrote:

> > Try adding the following line to /etc/hosts:
> >
> > a.b.c.d  hostname.your.domain  hostname
> >
> > of course, replacing a.b.c.d with your correct ip address.
> >
> > I don't know whether this is related to your problem, but it usually
> > solves the domainname: (none) problem.
>
> Is this meant to be the LAN private address, or the Internet address
> of the host?

It depends. If you just need to solve the agetty banner problem which 
prints "welcome to machinename.(none)", you can just use 127.0.0.1 or 
eth0's address, and this always has solved all the problems for me until 
now. Otherwise, you have to know what address the application uses to 
identify the box. However, if in doubt, nothing stops you from adding 
several lines that differ only in the ip address:

127.0.0.1 hostname.your.domain  hostname
10.0.0.1 hostname.your.domain  hostname
100.100.100.100 hostname.your.domain  hostname

etc.

NOTE: I don't know whether this is the correct way to do things. Many 
times it works, but other, less clumsy, ways probably exist (I simply 
haven't had the need to search them until now).
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Use of gethostname() and getdomainname()

2007-12-02 Thread Kevin O'Gorman
I like keeping it to stuff that makes sense.  I don't put in private network
addresses unless I actually use them,
which would just be the 192.168.x.x addresses provided by my DSL router,
behind which I hide most of my
systems.  But for the present thread, I'm talking about the routable IP
number for this host: treat.kosmanor.com
is seen as 64.166.164.49.

I've got HOSTNAME=treat in /etc/conf.d/hostname, and the FQDN in
/etc/postfix/main.cf.

Meanwhile, I've stumbled on the Linux man page for uname(2).  It explains
some of this as lack of coverage from the standards.  Use "man 2 uname" and
look in the NOTES section.  It seems this is an area that has not been well
treated, and there's divergence among systems as well as among applications,
let alone between them.  Ugh.


On Dec 2, 2007 7:12 AM, Etaoin Shrdlu <[EMAIL PROTECTED]> wrote:

> On Sunday 2 December 2007, Mick wrote:
>
> > > Try adding the following line to /etc/hosts:
> > >
> > > a.b.c.d  hostname.your.domain  hostname
>
> > > of course, replacing a.b.c.d with your correct ip address.
> > >
> > > I don't know whether this is related to your problem, but it usually
> > > solves the domainname: (none) problem.
> >
> > Is this meant to be the LAN private address, or the Internet address
> > of the host?
>
> It depends. If you just need to solve the agetty banner problem which
> prints "welcome to machinename.(none)", you can just use 127.0.0.1 or
> eth0's address, and this always has solved all the problems for me until
> now. Otherwise, you have to know what address the application uses to
> identify the box. However, if in doubt, nothing stops you from adding
> several lines that differ only in the ip address:
>
> 127.0.0.1 hostname.your.domain  hostname
> 10.0.0.1 hostname.your.domain  hostname
> 100.100.100.100 hostname.your.domain  hostname
>
> etc.
>
> NOTE: I don't know whether this is the correct way to do things. Many
> times it works, but other, less clumsy, ways probably exist (I simply
> haven't had the need to search them until now).
> --
> [EMAIL PROTECTED] mailing list
>
>


-- 
Kevin O'Gorman, PhD