Jeff D on 10/08/07 04:07, wrote:
On Thu, 9 Aug 2007, Adam Hardy wrote:
Jeff D on 09/08/07 00:55, wrote:
On Thu, 9 Aug 2007, Adam Hardy wrote:
How exactly would I set the domain name on the machine - the name I
thought I'd chosen when setting up the system from CD?
At the moment on this machine when I run 'hostname --domain' it
returns nothing.
to set the domain name, add it into /etc/hosts, for example:
127.0.0.1 localhost
127.0.1.1 mybox.mynet.net mybox
in /etc/hostname :
mybox
at start up /etc/init.d/hostname.sh runs, parses these and comes up
the domain name.
to turn off dhcp provided /etc/host info, edit
/etc/dhcp3/dhclient.conf, there is a line that starts with request.
Remove domain-name-servers from that list and dhcp wont supply it. If
you read down further, you can supply your own through the option
variables.
for more dhcpclient goodness man dhclient.conf
Yes I tried to work out what was going on by reading the man pages,
but I didn't find it so illuminating. My problem is that the DHCP and
DNS server running dnsmasq is actually the gateway server and has a
second NIC connected to a modem, from which it gets its ip via DHCP,
hence the reason why this box is running dnsmasq for one NIC and
dhclient3 for the other.
It is the resolv.conf on this machine that is being rewritten
constantly by something.
In that context, do those instructions for setting the domain name on
the machine still hold? It slightly throws me that you quote the ip
address 127.0.1.1
You can put your IP in /etc/hosts as:
192.168.1.150 mybox.mynet.net mybox
i just had 127.0.0.1 in mine, sorry for the confusion on that.
This machine also gets its network info through dhcp, which also over
writes /etc/resolv.conf. If you want to keep certian info in there ,
like a search domain and specify a namserver, add to
/etc/dhcp3/dhclient.conf :
supersede domain-name "mynet.net mynet.local";
prepend domain-name-servers 127.0.0.1;
then, /etc/init.d/networking restart
and you should see in /etc/resolv.conf:
search mynet.net mynet.local
nameserver 127.0.0.1
nameserver 192.168.1.10
you will still need to have your ISPs dns server listed in
/etc/resolv.conf , as dnsmasq uses that as its name server.
then, you can add in hosts into /etc/hosts , restart dnsmasq and it will
reread /etc/resolv.conf and /etc/hosts
I hope that clears up things a little.
Yes it does clear things up and it's a great help, thanks.
Putting those changes into dhclient.conf set up the dhclient3 properly so that
my resolv.conf now looks just like it should as a gateway machine. Plus I can
now reach my server by name from my workstations, without having its hostname in
the /etc/hosts file.
It was strange that it wasn't mentioned anywhere in the dhcp or dhclient man
pages that resolv.conf is managed in this way.
I now have to figure out what is happening on the dhclient front on my
workstations, or at least my linux workstation since that has no concept of its
domain name still. There seems to be a chance of getting it sorted using dynamic
DNS with dhclient, but the man page claims it is unlikely to work!
Thanks
Adam
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]