| View previous topic :: View next topic |
| Author |
Message |
musv Advocate


Joined: 01 Dec 2002 Posts: 2181 Location: de
|
Posted: Tue Oct 02, 2007 5:13 pm Post subject: dhcpd doesn't create resolv.conf |
|
|
Hi,
I'm trying to connect my notebook (client) to the internet through my desktop computer (server).
On the desktop computer is running a pdsnd for caching and filtering dns an and dhcpd. I receive an IP on my notebook but the resolv.conf on the notebook is only created when I boot the notebook and it's always empty. dhclient eth0 on the notebook or /etc/init.d/net.eth0 also doesn't write anything to the resolv.conf
On the server:
| dhcpd.conf: |
ddns-update-style interim;
option domain-name "csn.tu-chemnitz.de hrz.tu-chemnitz.de informatik.tu-chemnit$
option domain-name-servers 192.168.0.1;
default-lease-time 43200;
max-lease-time 86400;
authoritative;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
host Fehlermelder {
hardware ethernet 00:08:74:9A:33:DB;
fixed-address 192.168.0.250;
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.254;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}
|
On the client (= Fehlermelder)
| /etc/conf.d/net: |
hotplug_eth0="no"
hotplug_ath0="yes"
config_eth0=( "dhcp" )
dhcp_eth0=""
|
When I restart the network on the client I receive an IP, I can ping to the server and to external ip-addesses, I can mount and export nfs drives. But I don't receive any data for /etc/resolv.conf. |
|
| Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6271 Location: Blighty
|
Posted: Tue Oct 02, 2007 5:58 pm Post subject: |
|
|
Do you have resolvconf-gentoo installed? If so, did you emerge --config resolvconf-gentoo ? _________________ When baselayout tells you to update config files or things break WE REALLY DO MEAN IT
Please add SOLVED to the thread title if your issue has been
Strip comments from configs please |
|
| Back to top |
|
 |
musv Advocate


Joined: 01 Dec 2002 Posts: 2181 Location: de
|
Posted: Tue Oct 02, 2007 6:43 pm Post subject: |
|
|
Thx, I installed it now on my client and it works. I didn't know about this package. Can you explain why is it necessary? Because if I receive my external IP on my server I don't need it.
And another thing (sorry for combining theses threads):
Client:
| resolv.conf: |
# Generated by resolvconf
search csn.tu-chemnitz.de hrz.tu-chemnitz.de informatik.tu-chemnitz.de
nameserver 127.0.0.1
|
How can I change 127.0.0.1 to a different IP?
Server:
| pdnsd.conf: |
global {
perm_cache=8192;
cache_dir="/var/cache/pdnsd";
run_as="pdnsd";
server_ip = any; # Use eth0 here if you want to allow other
# machines on your network to query pdnsd.
status_ctl = on;
# paranoid=on;
# query_method=tcp_udp; # pdnsd must be compiled with tcp
# query support for this to work.
min_ttl=15m; # Retain cached entries at least 15 minutes.
max_ttl=1w; # One week.
timeout=10; # Global timeout option (10 seconds).
}
# The following section is most appropriate for fixed connections to the Intern$
server {
label= "CSN-DNS";
ip = 134.109.102.249,134.109.102.1; # Put your ISP's DNS-server addres$
proxy_only=on; # Do not query any name servers beside your ISP's.
timeout=4; # Server timeout; this may be much shorter
# that the global timeout option.
uptest=if;
interface=eth0;
interval=10m; # Check every 10 minutes.
purge_cache=off; # Keep stale cache entries in case the ISP's
# DNS servers go offline.
}
|
server_ip works with 127.0.0.1, and any on the server. But the client always receives 127.0.0.1. When I write 192.168.0.1 or my external IP to the server_ip it doesn't work anymore. |
|
| Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6271 Location: Blighty
|
Posted: Tue Oct 02, 2007 10:31 pm Post subject: |
|
|
| musv wrote: | | Thx, I installed it now on my client and it works. I didn't know about this package. Can you explain why is it necessary? Because if I receive my external IP on my server I don't need it. |
You don't need it, but if you have it installed it the dhcp clients assume it has been configured correctly.
| Quote: |
And another thing (sorry for combining theses threads):
Client:
| resolv.conf: |
# Generated by resolvconf
search csn.tu-chemnitz.de hrz.tu-chemnitz.de informatik.tu-chemnitz.de
nameserver 127.0.0.1
|
How can I change 127.0.0.1 to a different IP? |
Simple, don't define a local resolver
If you have nameserver 127.0.0.1 then it means you're offloading local dns from libc to something more powerful. I use dnsmasq myself on my laptop.
| Quote: |
server_ip works with 127.0.0.1, and any on the server. But the client always receives 127.0.0.1. When I write 192.168.0.1 or my external IP to the server_ip it doesn't work anymore. |
Well, post your /etc/conf.d/net config then.
No client should ever receive 127.0.0.1, but may force it locally which is probably the case. _________________ When baselayout tells you to update config files or things break WE REALLY DO MEAN IT
Please add SOLVED to the thread title if your issue has been
Strip comments from configs please |
|
| Back to top |
|
 |
musv Advocate


Joined: 01 Dec 2002 Posts: 2181 Location: de
|
Posted: Wed Oct 03, 2007 8:32 am Post subject: |
|
|
| UberLord wrote: | | Well, post your /etc/conf.d/net config then. |
dhcpd.conf (Server) and /etc/conf.d/net (client) are the ones from my first post.
Searching the net I found this one:
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg396160.html
Ok, the posted patch only touches the init-script and resolvconf on Debian but maybe it's the same problem.
Strange for me is the behaviour of dhcpd. Why does the entry
| Code: | | option domain-name-servers 192.168.0.1; |
exist, if I receive on the client only
| Code: | | nameserver 127.0.0.1 | ?
dhcpd is really strange in some things. Maybe I'll switch to dnsmasq. |
|
| Back to top |
|
 |
musv Advocate


Joined: 01 Dec 2002 Posts: 2181 Location: de
|
Posted: Wed Oct 03, 2007 10:15 am Post subject: |
|
|
| Ok, I deinstalled pdnsd and shut down dhcpd. Every functionality I need including adblock I get from dnsmaq on every computer in the net. |
|
| Back to top |
|
 |
UberLord Retired Dev


Joined: 18 Sep 2003 Posts: 6271 Location: Blighty
|
Posted: Wed Oct 03, 2007 10:31 am Post subject: |
|
|
resolvconf -l
See which interface is giving the 127.0.0.1 address _________________ When baselayout tells you to update config files or things break WE REALLY DO MEAN IT
Please add SOLVED to the thread title if your issue has been
Strip comments from configs please |
|
| Back to top |
|
 |
hoyanf Tux's lil' helper

Joined: 27 Aug 2005 Posts: 78 Location: Malaysia
|
Posted: Thu Nov 01, 2007 4:56 pm Post subject: |
|
|
I used dns caching with these setting from wiki :- http://gentoo-wiki.com/TIP_Gentoo%27s_resolv.conf_handling
Edited /etc/conf.d/net with the following so as on reboot it'll stick onto /etc/resolv.conf
| Code: | | dns_servers_bond0="127.0.0.1 208.67.222.222 208.67.220.220" |
It's good thing to add external dns server such as opendns.com as forwarder...
Regards,
hoyanf _________________ Opteron 165 1GB DDR Quadro FX1400 256MB
Athlon64 X2 4000+ 2GB DDR2 GeForce 7600GT 256MB |
|
| Back to top |
|
 |
gentoo_ram Guru

Joined: 25 Oct 2007 Posts: 349 Location: San Diego, California USA
|
Posted: Thu Nov 01, 2007 10:04 pm Post subject: |
|
|
I'm looking at the dhcp.conf from the OP. My dhcp.conf on my home server is slightly different.
Instead of making:
option domain-name-servers 192.168.0.1;
global. How about making a separate one for each subnet.
Within the 192.168.0.1 subnet declaration:
option domain-name-servers 192.168.0.1;
And within the 192.168.1.0 subnet:
option domain-name-servers 192.168.1.1; |
|
| Back to top |
|
 |
hoyanf Tux's lil' helper

Joined: 27 Aug 2005 Posts: 78 Location: Malaysia
|
Posted: Thu Nov 01, 2007 10:36 pm Post subject: |
|
|
DNS should work as long as gateway announces the nameservers...
You could do load balancing base on your set-up too...
Regards,
hoyanf _________________ Opteron 165 1GB DDR Quadro FX1400 256MB
Athlon64 X2 4000+ 2GB DDR2 GeForce 7600GT 256MB |
|
| Back to top |
|
 |
pmatos Veteran

Joined: 06 Jun 2003 Posts: 1220 Location: Cambridge, UK
|
Posted: Sat Nov 03, 2007 12:41 pm Post subject: |
|
|
| UberLord wrote: | | Do you have resolvconf-gentoo installed? If so, did you emerge --config resolvconf-gentoo ? |
doing config just creates a bad link:
| Code: | # ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 26 Nov 3 12:38 /etc/resolv.conf -> resolvconf/run/resolv.conf |
There's no "resolvconf/run/resolv.conf"
so I'm sticking to my hand made link:
| Code: | | ln -s resolvconf/run/interfaces/eth0 resolv.conf |
|
|
| Back to top |
|
 |
|