Return to BSD News archive
Newsgroups: comp.os.386bsd.questions
From: brian@awfulhak.demon.co.uk (Brian Somers)
Path: sserve!newshost.anu.edu.au!munnari.oz.au!network.ucsd.edu!usc!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!uunet!pipex!bnr.co.uk!demon!awfulhak.demon.co.uk!brian
Subject: Re: [NetBSD 0.8] Proper setup of network ?
Distribution: world
References: <1993Jun30.060039.28572@njitgw.njit.edu>
Organization: tp
Reply-To: Brian@awfulhak.demon.co.uk
X-Newsreader: Simple NEWS 1.90 (ka9q DIS 1.21)
Lines: 51
Date: Mon, 5 Jul 1993 18:13:26 +0000
Message-ID: <741896006snz@awfulhak.demon.co.uk>
Sender: usenet@demon.co.uk
In article <1993Jun30.060039.28572@njitgw.njit.edu> kxn3796@hertz.njit.edu writes:
>In article <1993Jun30.030503.26508@njitgw.njit.edu> I wrote:
>>I'm having trouble with network configuration on NetBSD 0.8.
>>
>>I used to use `pumpkin' as my local host name when I was using
>>386BSD 0.1 w/pk.0.2.3. And I overwrote filesystem with NetBSD.
>>I found /etc/myname changed so that it now has `unknown.host.domain'
>>as local host name. I wanted to use old name so I put `pumpkin'
>>into /etc/myname. Then one of my local daemon dies on boot with
>>dumping core. I looked into the code and narrowed the problem
>>down to gethostbyname(). gethostname() returns "pumpkin" but
>>gethostbyname("pumpkin") returns NULL and reference of returned
>>pointer to struct hostent, which is actually NULL, causes core dump.
>
>I should have written that actually whatever I put into /etc/myname,
>it never works. Executing "route add `hostname` localhost 0" always
>gives me a "bad value" error.
>
This is from 386BSD experience - not NETBSD. I assume they are the same
in this respect.
Make sure that you either re-boot after changing /etc/myname, or run
'hostname pumpkin' and log out/in. Also make sure that there is an
entry in /etc/hosts for pumpkin too. ie.
127.1 pumpkin
Even better, if you're connected to a network, then /etc/myname should
say
pumpkin.my.domain.name
and /etc/hosts should say
nn.nn.nn.nn pumpkin.my.domain.name pumpkin
where nn.nn.nn.nn is your numerical internet number. gethostbyname()
should just look through /etc/hosts. As for the route command, I believe
you shouldn't be using the '0' argument. I've had problems trying to
route my hostname through localhost, and ending up having
ifconfig lo0 inet `hostname` netmask 0xffffff00
in /etc/netstart (instead of localhost).
Hope this helps.
--
Brian <brian@awfulhak.demon.co.uk>