# FQDN not working on AMD64, so can't use setup Qmail.

## Decibels

I know a lot of this has been beat to death. I have no problems on my x86 system, but did it so long ago and not sure it is even correct though it is working there. Qmail is working on it also. Just can't seem to get either working correctly on the AMD64 and am sure qmail is not working cause can't get the FQDN to work on the amd64.

So maybe there is something I have emerged on the old x86 system I don't have on the amd64? Actally looks like I had to do the same thing on the x86 system. Thought could do it 'correct' way this time. But after doing all the below, looks like it might be because of having a static IP on a router that gets it's IP from ISP with DHCP (just an idea).

Basics: 

1) I really only need this to get some progs like Qmail to work.

2) Only using Qmail to email me cronjobs.

3) Network is working fine. Can access the internet, email,... so it isn't killing my system.

System Basics:

1)  IP Address is set statically to 192.168.1.100 . So not using DHCP to get an address.

2) Computer goes thru a Linksys Router which gets the IP from the ISP, it isn't a static IP though.

3) Only computer on the router at this time.

4) Relevent parts of my /etc/conf.d/net

```
iface_eth0="192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0"

gateway="eth0/192.168.1.1"
```

Current System Setup & what have tried that can remember:

1) Followed the Tip Setup Your FQDN at the Gentoo Linux Wiki. Didn't work.

So pasting the various parts in order of what is on the above.

```
#cat /etc/env.d/01hostname

HOSTNAME="decibels"
```

```
# cat /etc/conf.d/domainname

# /etc/conf.d/domainname

# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/domainname,v 1.1.4.1 2005/02/19 02:13:53 vapier Exp $

# When setting up resolv.conf, what should take precedence?

# If you wish to always override DHCP/whatever, set this to 1.

OVERRIDE=1

# To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf

# properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).

#

DNSDOMAIN="athlon.lan"

# This only set what /bin/hostname returns.  If you need to setup NIS, meaning

# what /bin/domainname returns, please see:

#

#   http://www.linux-nis.org/nis-howto/HOWTO/

#

#NISDOMAIN=""
```

Now he has 'domainname scriptkitchen.com' in there instead of DNSDOMAIN=" ", so maybe that is something to try?

He added domainname to boot, other say add it to default. Tried both:

```
#rc-update show

 domainname |    default

 hostname   |    boot
```

Then with /etc/hosts (which I read that qmail doesn't use anyway, but still)

```
# cat /etc/hosts

127.0.0.1       localhost

192.168.1.100   decibels.athlon.lan athlon
```

That is what have at the current moment. Have had several, best I can remember is:

```
# cat /etc/hosts

127.0.0.1       decibels.athlon.lan localhost

192.168.1.100   decibels.athlon.lan athlon
```

and

```
# cat /etc/hosts

127.0.0.1       decibels.athlon.lan localhost.localdomain localhost

192.168.1.100   decibels.athlon.lan athlon
```

That is pretty much the end of the TIP GUIDE:

Taking note of what is said in /etc/conf.d/domainname, I added it to /etc/resolv.conf also and is what is in there now.

```
#domain network

nameserver 24.217.0.4

nameserver 24.217.0.44

domain athlon.lan

```

Seems to have flipped it. I had the 'domain athlon.lan' in there before the nameserver(s).

Now some extra stuff. Boot tells you now to use /etc/domainname and not /etc/dnsdomainname (what currently has):

```
# cat /etc/dnsdomainname

athlon.lan

```

Wondering if should just delete that file now. Going to try that in a minute.

Same thing with /etc/hostname, it tells you to use /etc/conf.d/hostname now. Currently it is set with the 'decibels'. Going to delete that file also and see what happens. Haven't deleted either yet.

Current results from hostname and domainname commands. (Note: During BOOT, it did say 'setting hostname to 'decibels' & setting DNS domainname to 'athlon.lan' . So it said setting them, but don't get the FQDN later.)

```
 # hostname

decibels

# domainname

(none)

# hostname -v

gethostname()=`decibels'

decibels

# hostname -f

hostname: Unknown host

# domainname -a

domainname: Unknown host

# hostname -d

hostname: Unknown host

.......
```

Just don't know what I wrong, I am doing wrong, what I might now have set or emerged,.... At wits end. There seems to be umpteen ways to do this, but none of it seem to be working. Never had these problems in the past. Am now. Any help. 

Going to delete the /etc/hostname and /etc/dnsdomainname now and see what reboot brings.

----------

## Decibels

Okay, still not working, but this is what tried:

1) Removed /etc/hostname & /etc/dnsdomainname

Results: Got some thing during boot:

Setting hostname to 'decibels'

Setting DNS domainname to "athlon.lan'

2) Commented out in /etc/conf.d/domainname and added:

```
#DNSDOMAIN="athlon.lan"

DOMAINNAME="athlon.lan"

```

The only thing that seemed to do is not say: Setting DNS domainname to "athlon.lan"

The hostname and domainname commands produced the same exact results.

I am at my wits end. Nothing seems to work. Got the feeling there is some DNS or DHCP prog forgot to emerge???

Using 2.6.11-gentoo-r5 if that makes any diff.

----------

## Decibels

No one has any answers or questions huh?  :Crying or Very sad: 

Well, got qmail working. Was able to send email to users, postmaster and root. Picked them all up in Kmail like before.

Got the FQDN working. Not sure it is proper, but no one had a answer, none of the docs worked.

Did this: Just put the fqdn inplace of hostname in most places:

```
# cat /etc/hostname

decibels.athlon.lan

# cat /etc/conf.d/hostname

HOSTNAME="decibels.athlon.lan"

# cat /etc/env.d/01hostname

HOSTNAME="decibels.athlon.lan"
```

Left the rest the same as far as domain:

```
#cat /etc/conf.d/domainname

DNSDOMAIN="athlon.lan"

# cat /etc/resolv.conf

#domain network

nameserver 24.217.0.4

nameserver 24.217.0.44

domain athlon.lan

# cat /etc/dnsdomainname

cat: /etc/dnsdomainname: No such file or directory (still left that deleted, probably get rid of /etc/hostname also).
```

So when ran the qmail ebuild command got this and worked:

```
 # ebuild /var/db/pkg/mail-mta/qmail-1.03-r15/qmail-1.03-r15.ebuild

Your fully qualified host name is decibels.athlon.lan.

Putting decibels.athlon.lan into control/me...

Putting athlon.lan into control/defaultdomain...

Putting athlon.lan into control/plusdomain...

Putting decibels.athlon.lan into control/locals...

Putting decibels.athlon.lan into control/rcpthosts...

Now qmail will refuse to accept SMTP messages except to decibels.athlon.lan.
```

So problems solved, if anyone has a clue/idea/supplement/whatever on why had to go this route, feel free to pipe in. Otherwise this might help others that run into the same situation.

----------

## Decibels

Only have so far found one thing this seems to mess up. To this day, checking hostname, hostname -f, dnsdomainname, uname -a,... still shows like it should even though have not done this according to the books.

The thing that seems messed up is when look at boot text:

```
This is decibels.athlon.lan.athlon.lan (Linux x86_64 2.6.11-gentoo-r5) 06:51:43
```

Not sure where the above comes from yet, greping for "This is" hasn't produced anything useful yet. But like said, uname -a shows correctly:

```
Linux decibels.athlon.lan 2.6.11-gentoo-r5 #4 Tue Apr 12 16:43:33 CDT 2005 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux
```

----------

## millerl

I'm having the exact same issues...

It sounds like I've tried everything just as you have...   Why is there not a clear cut way to do this?  Noone seems to have an answer. =S

I'll try what you've done and report back with results.

----------

## millerl

So far what I've got is to:

```
/etc/hosts:

127.0.0.1 myhost.mydomain.com myhost localhost

/etc/hostname:

myhost

/etc/conf.d/domainname:

domainname mydomain
```

This seems to work and gets the login prompt to display properly and I also get:

```
# hostname

myhost

# hostname -f

myhost.mydomain.com

# domainname

mydomain.com
```

I tried moving /etc/hostname to /etc/conf.d/hostname but I got a complaint on boot saying I need to add a /etc/hostname and then it set the hostname to "localhost"

Hope this helps?  =/

----------

