View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Wed Apr 11, 2012 6:26 am Post subject: misconfigured dhcp? |
|
|
The network actually has several wired (static ip) and wireless (dhcp) machines on it, but for simplicity:
There are two hosts - static and dynamic.
The hosts files (identical on both machines):
Code: |
127.0.0.1 localhost.domain.local localhost
192.168.0.2 static.domain.local static
|
/etc/resolv.conf on the dhcp machine:
Code: |
# Generated by resolvconf
search domain.local
nameserver 1.2.3.4
nameserver 5.6.7.8
|
The relevant part of /etc/nsswitch.conf (both machines):
Code: |
hosts: files dns
networks: files dns
|
I am encountering two problems.
First, dynamic is not getting assigned the domain name (but static is):
Code: |
$ hostname -f
hostname: Unknown host
$ hostname -a
hostname: Unknown host
$ hostname -d
hostname: Unknown host
$ hostname
dynamic
$ hostname -f
static.domain.local
|
Second (and more important) dynamic can't resolve static even though it is in the hosts file:
Code: |
$ host static
Host static not found: 3(NXDOMAIN)
|
It seems to want to go the network dns even for localhost (which means something is very wrong):
Code: |
$ nslookup 127.0.0.1
Server: 1.2.3.4
Address: 1.2.3.4#53
1.0.0.127.in-addr.arpa name = localhost.
|
/etc/conf.d/net for static is quite basic (I don't even know where it is picking up the domain name from):
Code: |
config_eth0=( "192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0" )
routes_eth0=("default via 192.168.0.1")
|
/etc/conf.d/net for dynamic is also relatively simple:
Code: |
modules='wpa_supplicant'
config_wlan0='dhcp'
dhcp_wlan0_domain='nodns'
wpa_supplicant_wlan0='-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf'
|
I guess that leads me to my third question. /etc/resolv.conf keeps getting overwritten despite my attempt to prevent that with this ssid (called domain). Can someone explain why?
Thank you in advance for your assistance. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23062
|
Posted: Thu Apr 12, 2012 2:15 am Post subject: Re: misconfigured dhcp? |
|
|
curmudgeon wrote: | Second (and more important) dynamic can't resolve static even though it is in the hosts file:
Code: | $ host static
Host static not found: 3(NXDOMAIN)
| It seems to want to go the network dns even for localhost (which means something is very wrong): | That is what host does. If you do not want to contact the DNS server, do not use host.
curmudgeon wrote: | Code: | config_eth0=( "192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0" )
routes_eth0=("default via 192.168.0.1") |
| This is baselayout-1 syntax. You should update it to baselayout-2 syntax, which does not use arrays. However, that is not likely to be the cause of the problem at hand. |
|
Back to top |
|
|
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Thu Apr 12, 2012 7:10 am Post subject: Re: misconfigured dhcp? |
|
|
Hu wrote: | That is what host does. If you do not want to contact the DNS server, do not use host. |
OK. Got that.
Hu wrote: | curmudgeon wrote: | Code: | config_eth0=( "192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0" )
routes_eth0=("default via 192.168.0.1") |
| This is baselayout-1 syntax. You should update it to baselayout-2 syntax, which does not use arrays. However, that is not likely to be the cause of the problem at hand. |
Yes, that is not the problem because that is what I have on the static machines (which work fine).
I don't even see where the hostname command is picking up the domain name (and of course, why it is not picking it up on the dhcp machines). |
|
Back to top |
|
|
|