View previous topic :: View next topic |
Author |
Message |
nadsys Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_fry_2.gif)
Joined: 01 Sep 2004 Posts: 97 Location: Darmstadt, Germany
|
Posted: Sun Sep 12, 2004 7:16 pm Post subject: dhcp/dns - not resolving to ip |
|
|
hello, i have 2pc's networked via a switch.
i have installed dnsmasq on one of the machines.
could someone have a look at this link and see if you see a flaw in it.
http://gentoo-wiki.com/HOWTO_setup_a_home-server#Extras_for_LAN_with_Many_Gentoo_Boxes
my problem (and HOWTO's problem imho) is this:
i boot up server, it loads everything fine. i ping nads.core.com (ping itself) and it returns 100% success with correct ip showing 192.168.0.25 192.168.0.255 255.255.255.0. perfect.
i then go to second pc, boot it up. it boots up error free. so i do ping lee.core.com (ping itself) and it succeeds too, showing ip of 192.168.0.16. this is the ip the server has sent it. perfect
i then go back to server and type ping lee.core.com. and i get unknown host. if i ping 192.168.0.16, it works.
now the guide's way works as he is fixing all hosts to a single ip, so its not really using the capabilites of dhcp giving/taking ip's and reallocating, its just fixing ip's to dns names.
how can i solve this without fixing all ip's to dns names?
hope you catch my drift, many thanx.
neil
easy technical language would be appreciated, still new and learning. thanx |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54832 Location: 56N 3W
|
Posted: Sun Sep 12, 2004 7:50 pm Post subject: |
|
|
nadsys,
The hosts file in the HOWTO only contains the static IPs on that network. The range for DHCP is defined as Quote: | dhcp-range=192.168.0.50,192.168.0.150 | Its a bit strange having a gateway in the middle of the dynamic range because it needs to be static.
To get names to work, when your boxes broadcast for a DHCP server, they need to send the name they wish to use. That goes in the /etc/conf.d/net.eth0 Quote: | # To use DHCP on eth0, simply uncomment the following line:
#ifconfig_eth0=( "dhcp" )
#dhcpcd_eth0="-t 10" |
You will need to check the man page for the syntax but Quote: | -h <hostname>
specifies a string used for the hostname option field when
dhcpcd sends DHCP messages. Some DHCP servers, notably those
used by @Home Networks, require the hostname option field con-
taining a specific string in the DHCP messages from clients.
| looks promising _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nadsys Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_fry_2.gif)
Joined: 01 Sep 2004 Posts: 97 Location: Darmstadt, Germany
|
Posted: Sun Sep 12, 2004 11:01 pm Post subject: more info on what i have. |
|
|
i list below only things i changed in each file.
/etc/dnsmasq contains:
dhcp-range=192.168.0.2,192.168.0.24
dhcp-host=00:0f:1f:b9:80:e3,192.168.0.25
dhcp-host=00:e0:18:A0:38:41,lee
no-negcache
so this is saying use a range of .2 - .24. set the server machines ip to .25. set the pc with above mac address to always call it lee. and to not set negative caching on dns lookup attempts.
on my other machine (redhat fedora 2) i have made it so it DOES send the hostname info when looking for a dhcp server.
my resolv.conf has no entries in it.
my hosts file looks like this:
127.0.0.1 localhost
192.168.0.25 nads.core.com nads
#192.168.0.10 lee.core.com lee
#192.168.0.11 nextmachine.core.com nextmachine
reason there commented out is because i dont want to define them to a static ip, as i said in last post. i want dhcp to assign an ip to lee.core.com and then to be able from the server to ping lee.core.com and it resolve to the correct ip.
i thought adding the mac address with lee in it would have solved the problem, it didn't.
any ideas? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nadsys Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_fry_2.gif)
Joined: 01 Sep 2004 Posts: 97 Location: Darmstadt, Germany
|
Posted: Mon Sep 13, 2004 8:49 am Post subject: |
|
|
bump (still unresolved).
does dnsmasq even have the ability to do what i require or can it only do dns reolving for things already defined in /etc/hosts |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nobspangle Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/210249061640b0c1d626f5b.gif)
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Mon Sep 13, 2004 1:34 pm Post subject: |
|
|
First, the machine running your dhcp server should have a static address (not assigned by dhcp).
You won't be able to resolve anything if you have no entries in resolv.conf. You need to give out the address of your dns server using dhcp.
I've never used dnsmasq and only know how to do this using bind and the isc dhcp server.
In /etc/bind/named.conf
Code: | key DHCP_UPDATER {
algorithm HMAC-MD5.SIG-ALG.REG.INT;
secret APWgf5FEGetbpGANb9L1Mw==;
};
acl mynet {
192.168.0.0/24;
127.0.0.1;
};
options {
directory "/var/bind";
version "not currently available";
listen-on-v6 { none; };
listen-on { 127.0.0.1; 192.168.0.25; };
query-source address * port 53;
pid-file "/var/run/named/named.pid";
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "pri/localhost.zone";
allow-update { none; };
notify no;
};
# Reverse IP mapping for 192.168.0.x
zone "0.168.192.IN-ADDR.ARPA" {
type master;
file "pri/192.168.0.rev";
allow-query {mynet;};
allow-transfer {mynet;};
allow-update { key DHCP_UPDATER; };
};
# master for core.com
zone "core.com" IN {
type master;
file "pri/pri.core.com";
allow-query {mynet;};
allow-transfer {mynet;};
allow-update { key DHCP_UPDATER;};
}; | Then in /etc/dhcp/dhcpd.conf Code: | default-lease-time 21600;
max-lease-time 345600;
ddns-updates on;
ddns-domainname "core.com";
ddns-rev-domainname "in-addr.arpa";
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
#set the next line to the ip of your router
option routers 192.168.0.10;
option domain-name-servers 192.168.0.25;
option domain-name "core.com";
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.24;
}
ddns-update-style interim;
key DHCP_UPDATER {
algorithm HMAC-MD5.SIG-ALG.REG.INT;
secret APWgf5FEGetbpGANb9L1Mw==;
};
zone core.com. {
primary 192.168.0.10;
key DHCP_UPDATER;
}
zone 0.168.192.in-addr.arpa. {
primary 192.168.0.25;
key DHCP_UPDATER;
} |
generate the secret by doing Code: | dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER | then open the .private file it creates and the key should be on the last line. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nadsys Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/gallery/Futurama/cartoon_futurama_fry_2.gif)
Joined: 01 Sep 2004 Posts: 97 Location: Darmstadt, Germany
|
Posted: Mon Sep 13, 2004 3:10 pm Post subject: |
|
|
success to a degree.
added "nameserver 192.168.0.25" to resolv.conf so it now has my host/server as the machine it goes to to resolv entries.
now, i type ping lee and it returns good info for that.
i type ping lee.core.com and it says inknown host?
if i go to client lee and type uname -a it shows lee.core.com
at the prompt, if i type hostname, then it returns lee.core.com
at the prompt if i type dnsdomainname then it returns core.com
all the above are to best of my knowledge correct.
the one thing i MIGHT be missing is an entry for domainname cos if i type that at the prompt it shows "(none)" . reason i didn't set that is because the HOWTO didn't, section 8.b
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8
any info, much appreciated,
thank you
Neil |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|