Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
misconfigured dhcp?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1633

PostPosted: Wed Apr 11, 2012 6:26 am    Post subject: misconfigured dhcp? Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15989

PostPosted: Thu Apr 12, 2012 2:15 am    Post subject: Re: misconfigured dhcp? Reply with quote

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
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1633

PostPosted: Thu Apr 12, 2012 7:10 am    Post subject: Re: misconfigured dhcp? Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum