1

I've just configured a PC with a dhcp server and an apache server on it. I want to set a hostname to my server (i.g "myserver") in order to be able to access its web server by writing on the browser "myserver:80". Here's the dhcpd.conf file:

#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.0.2.0 netmask 255.255.255.0 {
  range 192.0.2.2 192.0.2.254;

  host myserver{
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 192.0.2.1;} 
}

Thanks!!

1

edit your /etc/hosts file of your PC and add the following:

192.0.2.1    myserver

If you'd like to be able to access myserver across the entire network, you'd need to configure an internal DNS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.