Re: [Dorset] Setting up hostname in Linux
On Monday, April 04, 2011 11:37:19 PM Ralph Corderoy wrote: > Hi Terry, > > > Maybe my memory is faulty, but my recollection of doing this on > > earlier Unix systems, (like Solaris), is that the hostname went into > > the file called hostname (or similar) and that did it (after a > > reboot). > > Debian/Ubuntu still have that. > > $ cat /etc/hostname > orac > $ hostname > orac > $ hostname -f > orac > $ > > Note, the -f output is wrong here, I haven't got it to be correct yet > which is annoying as some programs, e.g. postfix, rightly expect it to > be a fully-qualified domain name (FQDN). > > Cheers, > Ralph. FC14 seems to use the /etc/sysconfig tree to hold this kind of info /etc/sysconfig/network:HOSTNAME=myhostname & /etc/rc.sysinit reads the sysconfig tree Regards Andy -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Setting up hostname in Linux
On 04 April 2011 at 23:37 Ralph Corderoy wrote: > > Hi Terry, > > > Maybe my memory is faulty, but my recollection of doing this on > > earlier Unix systems, (like Solaris), is that the hostname went into > > the file called hostname (or similar) and that did it (after a > > reboot). > > Debian/Ubuntu still have that. > > $ cat /etc/hostname > oracI think what confused me is that TinyCore seems to have two >independent ways of setting the hostname; the file hostname, just like Debian >and Solaris, etc and the bootcode hostname=Myname. It was really confusing, because with the hostname set in the hostname file, I was able to ping 'Myname' successfully, but DNS didn't work and the command hostname returned 'box'. Once I added the bootcode, everything worked. I think I've established that this bootcode method is (if not unique) special to TC; presumably so that a LiveDisc user can set the hostname of a CD based system. I don't have a problem with that, but they shouldn't be independent. I'd have expected the bootcode to write to the hostname file, to keep everything consistent. Terry Coles -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Setting up hostname in Linux
On Mon, 04 Apr 2011 23:37:19 +0100, ra...@inputplus.co.uk said: > Note, the -f output is wrong here, I haven't got it to be correct yet Put an entry in /etc/hosts with the fully qualified domain name (FQDN). If the system has a fixed IP address, use it; if not, use 127.0.1.1. Your /etc/hosts will then look like: 127.0.0.1 localhost 10.0.0.100 system.example.com system or 127.0.0.1 localhost 127.0.1.1 system.example.com system That will fix the 'hostname -f' problem. -- "You can have everything in life you want if you help enough other people get what they want" - Zig Ziglar. Who did you help today? -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Setting up hostname in Linux
Hi Terry, > Maybe my memory is faulty, but my recollection of doing this on > earlier Unix systems, (like Solaris), is that the hostname went into > the file called hostname (or similar) and that did it (after a > reboot). Debian/Ubuntu still have that. $ cat /etc/hostname orac $ hostname orac $ hostname -f orac $ Note, the -f output is wrong here, I haven't got it to be correct yet which is annoying as some programs, e.g. postfix, rightly expect it to be a fully-qualified domain name (FQDN). Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue
Re: [Dorset] Setting up hostname in Linux
> Here is a really basic question; how is the hostname defined in modern Linux > distributions? Generally this is done for us by the installer, so we don't > have > to know how to do it, other than fill in the name of the PC into the box > provided. I believe it's actually somewhat distro-specific. On Arch, it's stored in /etc/rc.conf, and further repeated in /etc/hosts on the first line, which is usually the loopback 127.0.0.1 line. -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue
[Dorset] Setting up hostname in Linux
Hi, Here is a really basic question; how is the hostname defined in modern Linux distributions? Generally this is done for us by the installer, so we don't have to know how to do it, other than fill in the name of the PC into the box provided. The reason I'm asking is that I've just spent about a week (off and on) trying to get DHCP and DNS to work on a Tiny Core Installation. I cracked it about half an hour ago, when I discovered that the hostname file had one thing in it ('Myname', which I had written there) and the output of the command 'hostname' gave 'box', which is the default for TC. I had to add the bootcode host='Myname' to get the right answer and then my DNS server started answering requests for pings etc to 'Myname'. Maybe my memory is faulty, but my recollection of doing this on earlier Unix systems, (like Solaris), is that the hostname went into the file called hostname (or similar) and that did it (after a reboot). Is that right, or should I be worried about my powers of recall? Terry Coles -- Next meeting: Bournemouth, Tuesday 2011-04-05 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ How to Report Bugs Effectively: http://goo.gl/4Xue