how to hiren boot by dnsmasq server

how to hiren boot by dnsmasq server


Q. Configure Dnsmasq as a Pxe Boot Server " hiren boot " ?

Q. How to configure a dnsmasq server in linux centos 6 ?

Q. step by step dnsmasq server configuration in linux centos 6 ?

IP  -

Hostname - 

OS  - CentOS 6

Dnsmasq provides network infrastructure for small networks:. dnsmasq is a lightweight DNS, TFTP, PXE, router advertisement and DHCP server. It is intended to provide coupled DNS and DHCP service to a LAN. It is designed to be lightweight and have a small footprint, suitable for resource constrained routers and firewalls. It has also been widely used for tethering on Smartphone’s and portable hotspots, and to support virtual networking in virtualization frameworks.

  • domain-neededThis tells dnsmasq to never pass short names to the upstream DNS servers. If the name is not in the local /etc/hosts file then “not found” will be returned.

  • bogus-priv All reverse IP (10.20.x.x) lookups that are not found in /etc/hosts will be returned as “no such domain” and not forwarded to the upstream servers.

  • no-resolv Do not read resolv.conf to find the servers where to lookup dns.

  • no-poll Do not poll resolv.conf for changes

  • server= Set one or more DNS servers to use when addresses are not local. These are open DNS servers.

  • local=/ Our local domain, queries in these domains are answered from /etc/hosts or the static-hosts files.

  • address=/ Use this force an address for the specified domains. e.g to block adverts force to localhost

  • no-hosts This options stops dnsmasq using the local /etc/hosts file as a source for lookups .

  • addn-hosts=/etc/dnsmasq.d/static/hosts.conf Force dnsmasq to use this file for lookups. It is in the same format as /etc/hosts.

  • expand_hosts So we can see our local hosts via our home domain without having to repeatedly specify the domain in our /etc/hosts file.

  • domain This is your local domain name. It will tell the DHCP server which host to give out IP addresses for.

  • dhcp-range This is the range of IPs that DHCP will serve: to, with a lease time of 12 hours. The lease time is how long that IP will be linked to a host.

  • dhcp-host=client,,36h Any machine saying they are hostname = ‘client’ gets this IP address

  • dhcp-option=option:router, When a host is requesting an IP address via DHCP also tell it the gateway to use.

  • dhcp-option=option:ntp-server, When a host is requesting an IP address via DHCP also tell it the NTP to use.
Install Dnsmasq server and

# yum install dnsmasq*

# yum install syslinux*

Configuration Dnsmasq server as a PXE Boot

Enable configuration directory " conf-dir=/etc/dnsmasq.d "

# vi /etc/dnsmasq.conf

create new pxe.conf file in configuration directory " dnsmasq.d "

# vi /etc/dnsmasq.d/pxe.conf

To Enable TFTP Server by adding this section

tftp-root=/khandwa/     # here "/khandwa/" is path of tftp server

Dhcp Boot Option


Here i used "proxy" because i have already dhcp server in network if you don't have a dhcp server you can define range of ip
set pxe Boot Option

pxe-prompt="Press F8 for boot menu", 3
pxe-service=X86PC, "Boot from local hard disk", 0
pxe-service=X86PC, "Boot from network", pxelinux

Copy syslinux file in tftp server root directory

# mkdir /khandwa/
# cp /usr/share/syslinux/menu.c32 /khandwa/
# cp /usr/share/syslinux/pxelinux.0 /khandwa/
# cp /usr/share/syslinux/chain.c32 /khandwa/
# cp /usr/share/syslinux/memdisk /khandwa/
# cp /usr/share/syslinux/mboot.c32 /khandwa/
Create pxelinux.cfg directory

# mkdir /khandwa/
Create "default" file for boot menu

# vi /khandwa/
default menu.c32

prompt 0

timeout 300


# Menu for Hiren Live Boot

LABEL Hiren # label name of iso

MENU LABEL Hirens BootCD # menu label name 

KERNEL memdisk # kernel for ISO image called memdisk

APPEND iso initrd=hiren10.iso raw # path of iso image, here iso image path /khandwa/

Restart Service

# service dnsmasq restart

If you get error after Restart the Service

dnsmasq: failed to create listening socket: Address already in use

check port of dns ( 53 ) & kill it

# netstat -anlp | grep -w LISTEN

Kill this process

# kill -9 1792

Now Again restart service

# service dnsmasq restart

Now go to the client maching and boot form network

Note : enable network boot setting in BIOS

Next Post »