Hot answers tagged

18

Some DHCP servers send out host names. Clients can accept or ignore such offers. Have a look at your local /etc/dhcp/dhclient.conf file to inspect your current configuration. There is a list of request entities one of which will probably readhost-name. For more information check out the man page of dhclient.conf.


12

Put only 127.0.0.1 as a name server in /etc/resolv.conf, and run a DNS cache locally. I recommend Dnsmasq, it's lightweight and easy to setup. On distributions such as Debian and Ubuntu, I also recommend installing the resolvconf package, which takes care of maintaining /etc/resolv.conf when you aren't running a local DNS cache, or of maintaining the DNS ...


12

Right click on the Network Manager icon on Ubuntu top panel and select edit. Go to Wired Network or Wireless Network tab and select the network name. Click on the edit button and go to IPv4 settings tab on the new window. If the method is Automatic (DHCP) you are using dhcp. Other method is cat /var/log/syslog and check for some thing like below ...


11

VirtualBox DHCP is working properly. There is nothing wrong with having all of your machines getting the same address in NAT configuration. All VMs are isolated from each other so there is no risk of conflict. They are also not on the same adapter. Each VM has its own virtualized hardware including NICs. The default gateway also need not to be 10.0.2.1. ...


10

You can provide static IP by editing the file /etc/sysconfig/network-scripts/ifcfg-eth0 as root user in Redhat. It should look like this: DEVICE=eth0 BOOTPROTO=STATIC IPADDR=192.168.0.5 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 ONBOOT=yes After saving this file. You need to restart the network daemon using following command. $ sudo /etc/init.d/network ...


10

The best way to guarantee the same IP at all times for a given host is to set up a MAC Address IP reservation in the DHCP server. Get the MAC address if your laptop, then go to your DHCP server, and assign a specific IP address to be issued to a host requesting from that MAC address.


10

1) You shouldn't manually update your resolv.conf, because all changes will be overwritten by data that your local DHCP server provides. If you want it to be static, run sudo dpkg-reconfigure resolvconf and answer "no" to dynamic updates. If you want to add new entries there, edit /etc/resolvconf/resolv.conf.d/base and run sudo resolvconf -u, it will append ...


9

Okay, can I get a "D'oh!" from the congregation! In RHEL6 and derivatives, the dhcpd config file is now located at /etc/dhcp/dhcpd.conf, not /etc/dhcpd.conf. Moved the file and all is well.


9

No, you can only get this information server side from the DHCP server. This information is contained in the DHCP server's .lease file: /var/lib/dhcpd/dhcpd.leases, if you're using ISC's DHCP server. Example $ more /var/lib/dhcpd/dhcpd.leases # All times in this file are in UTC (GMT), not your local timezone. This is # not a bug, so please don't ask ...


9

The dhclient that NetworkManager calls should be the same irregardless. On my Fedora 19 system I'm getting the following command run via NetworkManager when I allow it to connect: /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-client.action \ -pf /var/run/dhclient-wlp3s0.pid \ -lf ...


7

resolvconf is a program to manage the resolv.conf file so that multiple sources can add and remove entries without tripping over each other. The manager of each network interface feeds it a resolv.conf file for that interface, and it merges them all together. resolvconf is meant to be run by network scripts or DHCP clients, but you can also run it ...


7

isc-dhcpd package version 4.3.1 has this command to list leases: dhcp-lease-list --lease PATH_TO_LEASE_FILE This is a simple perl script script that also supports older DHCP releases. You can see a copy in the Debian source code or in the official DHCP distribution (in contrib/) as well. The output is pretty: $ perl contrib/dhcp-lease-list.pl --lease ...


7

You can add the following line to /etc/dhcp/dhclient.conf: prepend domain-name-servers <working DNS IP(s) here>; This adds the DNS IP address(es) you specify before that/those provided by the DHCP. If you would like to add it/them after the address(es) provided by the DHCP, just use append domain-name-servers <working DNS IP(s) here>; If, ...


7

If you specify allow-hotplug eth0 instead of auto eth0 in /etc/network/interfaces, then the connection will only be initiated by udev when something triggers it, instead of at every boot. Hopefully that will be when another device is connected to the other end of your cable...


6

If the host sends its name you can retrieve it from DNS. If you know its IP address you just do a reverse lookup on the IP address. One of these commands should work (use the host's IP address in place of 192.0.32.10): host 192.0.32.10 nslookup 192.0.32.10 You can retrieve a list of all leases including the name provided if any from your dhcp.leases ...


6

This is how I made Debian use more than 3 nameservers at a time. Install dnsmasq package Configure my local DHCP client not to use DNS server addresses provided by DHCP server, but only local server instead. To do so I add in my /etc/dhcp/dhclient.conf file the following line supersede domain-name-servers 127.0.0.1; Configure dnsmasq not to use the ...


6

In (I believe) /etc/default/dhcp3-server, add the line INTERFACES="eth0 eth1" Now in the dhcpd.conf configuration file, you define two different subnet and the respective options. subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option routers 192.168.1.1; range 192.168.1.100 192.168.1.200; } subnet 192.168.2.0 ...


6

On Ubuntu there is the file /var/lib/dhcp/dhcpd.leases, but it is rather verbose and you probably need a little script if you want more high level statistics. I am unaware of existing tools to do this. There is a separate man page for this file man dhcpd.leases describing the database format.


6

If you are using isc-dhcp-client, provisions are made for "hook scripts" which will run at various stages of the DHCP process, including when an address is acquired. /etc/dhcp/dhclient-enter-hooks.d or similar.


6

dnsmasq is simpler and because of that has less features. But if you don't need anything fancy and since you were already able to set it up, you probably don't need them. Dnsmasq is designed for small, local networks. You can read on its site that by small networks, they mean up to 1000 computers so it's not that bad. So my answer is: there is absolutely ...


6

isc-dhcp-server is the new name for the dhcp3-server package, so this is behaving as expected. Debian sarge is fairly old, so you can expect that tutorial to be outdated.


6

The subnet mask that you have specify in dhcpd.conf must match your interface subnet mask. Run: /sbin/ifconfig eth0 You specified the subnet mask as 255.255.255.0, this is most likely wrong. Change your dhcpd.conf to match your interface. The interface where the DHCP server is listening must have an Static IP of the same subnet you are using in your ...


6

An option for you is counting number of lease declaration in dhcpd.leases: dhcpd.leases(5) - Linux man page Name dhcpd.leases - DHCP client lease database .... the Lease Declaration lease ip-address { statements... } Each lease declaration includes the single IP address that has been leased to the client. The statements within the braces define the ...


6

This is not a direct solution but it would seem you could make use of the on commit facility within your DHCP configuration file. Here's an example from this articled titled: Execute a script when ISC DHCP hands out a new lease. In the dhcpd.conf file you can create actions on various events such as when a lease is given out. subnet 192.168.1.0 netmask ...


6

The original DHCP specification (RFC 2131 and 2132) defines an option (33) that allows the administrator of the DHCP service to issue static routes to the client if needed. Unfortunately, that original design is flawed these days as it assumes classful network addresses, which is rarely used. The rfc3442-classless-static-routes option allows you to use ...


5

What is the question here? Yes, it sounds like you have two addresses assigned. Yes you can talk to the box using either one of them. If you talk from that box to other machines, it will use the most relevant address, meaning if there is an IP address in the same subnet, it will use that one to talk. One of the addresses, probably the one assigned first, ...


5

It depends on what is doing the DHCP? Most home routers use dnsmasq and you can use that as your local DNS server. You just need to set dnsmasq to return itself as the DNS server. Next, you need to make sure that your PCs broadcast a hostname during the DHCP request. Then, voila, you should be able to resolve all your local machines through the DNS/DHCP ...


5

As noted by Warren and Shawn, your question seems to imply that preventing address assignment to unregistered machines is intended to keep them off the net. You cannot increase security this way as an machine can either: find a "trusted" MAC address and pretend to have that MAC to get an IP address from the DHCP server, or Just pick its own IP address ...


5

Seems my question is answered in the libvirt manual. One needs to specifically ensure that the same IP is handed out via DHCP each time. Here's how this can be specified: <network> … <ip address="192.0.2.1" netmask="255.255.255.0"> <dhcp> <range start="192.0.2.128" end="192.0.2.254"> <host ...


5

Checking status of leases is easiest with analysis tool. http://dhcpd-pools.sourceforge.net/



Only top voted, non community-wiki answers of a minimum length are eligible