Page 1 of 1

[Solved] DHCP IP Address with Static DNS Possible?

Posted: 03 Oct 2014, 03:35
by jmalon
Is it possible to set static and over riding DNS settings while still using DHCP to obtain an IP address? This would be useful in order to use OpenDNS, Norton ConnectSafe (aka Norton DNS), or other DNS servers to over ride the DNS servers handed out by your ISP for increased security and content filtering. It would be great if this function could be rolled into the Kiosk Wizard.

Thank you for a great product!

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 03 Oct 2014, 07:36
by fanthom
hello John,

doing this on the kiosk level is not that easy.
maybe you could specify a DNS server in your dhcpc daemon config? for example in case of dnsmasq you would have to add:

Code: Select all

dhcp-option=6,192.168.0.90,192.168.0.98
as per:
http://serverfault.com/questions/163542 ... ns-servers

which dhcpc software are you using?

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 03 Oct 2014, 14:45
by jmalon
You could add an entry at the top of the /etc/resolv.conf file to specify the DNS servers you want to use, i.e. OpenDNS or Norton ConnectSafe. Would this not override the DNS servers assigned by the network's DHCP server?

Resolv.conf
https://wiki.archlinux.org/index.php/resolv.conf

Alternative DNS servers
To use alternative DNS servers, edit /etc/resolv.conf and add them to the top of the file so they are used first, optionally removing or commenting out already listed servers.
Note: Changes made to /etc/resolv.conf take effect immediately.

The DHCP client software is whatever is built into the Porteus Kiosk.

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 03 Oct 2014, 15:30
by fanthom
sorry - i probably was not clear enough.
i meant that you could edit a settings of your dhcpc server and add specific DNS IPs which should be assigned to the clients:
http://www.yolinux.com/TUTORIALS/DHCP-Server.html
please mind:

Code: Select all

option domain-name              "your-domain.org";
option domain-name-servers      40.175.42.254, 40.175.42.253;           # Default DNS to be used by DHCP clients
if you want to keep these DNS just for the kiosk PCs then you could filter them by MAC addresses:

Code: Select all

host ns2 {
                next-server ns2.your-domain.com;
                hardware ethernet 00:02:c3:d0:e5:83;
                fixed-address 40.175.42.254;
        }
i guess that adding 'domain-name-servers 40.175.42.254, 40.175.42.253;' to this block would affect just this particular PC.

i doubt many users would benefit if i implement static DNS on the client side. you are first one asking for this in the whole kiosk history and i dont want to overload wizard with too many less important features (it looks complicated already and new features are on the way).

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 17 Oct 2014, 19:42
by jmalon
Without using the kiosk wizard, how would I accomplish the task of over riding the DNS servers provided by the DHCP server?

I created a resolv.conf file in /etc (see below). I could browse the Internet, but the Norton ConnectSafe name servers were not used because I could still get to elephantlist.org, so I assume other sites would be viewable.

Code: Select all

cat resolv.conf
# Norton ConnectSafe name servers
# https://dns.norton.com/faq.html
# Policy 1: Security (199.85.126.10 and 199.85.127.10)
# Policy 2: Security + Pornography (199.85.126.20 and 199.85.127.20)
# Policy 3: Security + Pornography + Other (199.85.126.30 and 199.85.127.30)
nameserver 199.85.126.30
nameserver 199.85.127.30
I also tried adding echo statements to /etc/rc.d/rc.local to create entries in the /etc/resolv.conf on startup. Again, I could browse the Internet, but the Norton ConnectSafe name servers were not used.

Code: Select all

#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here and make this
# script executable.
echo 'nameserver 199.85.126.30' > /etc/resolv.conf
echo 'nameserver 199.85.127.30' >> /etc/resolv.conf
Any suggestions? Thank you for your help!

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 17 Oct 2014, 20:11
by fanthom
hi John,

a) please create /etc/resolv.conf containing your static DNS settings
b) take /etc/dhcpcd.conf from 003-settings.xzm and add to it:

Code: Select all

nohook resolv.conf
(this will disable dhcpcd from overriding /etc/resolv.conf)
c) create module containing these two files and add it to your remastered kiosk ISO

that should do it.

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 17 Oct 2014, 20:38
by jmalon
I'll give it a try and let you know. Thank you again for your help!

Re: DHCP IP Address with Static (Over riding) DNS Possible?

Posted: 17 Oct 2014, 21:22
by jmalon
Is /etc/dhcocd.conf in the 001-core.xzm, instead of 003-settings.xzm?

[Solved] DHCP IP Address with Static (Over riding) DNS Possi

Posted: 17 Oct 2014, 21:56
by jmalon
Great, that worked. Thank you so much!!!

Here are the steps for anyone else wanting to accomplish the same thing.

1. I created /etc/resolv.conf

Code: Select all

cat resolv.conf
# Norton ConnectSafe name servers
# https://dns.norton.com/faq.html
# Policy 1: Security (199.85.126.10 and 199.85.127.10)
# Policy 2: Security + Pornography (199.85.126.20 and 199.85.127.20)
# Policy 3: Security + Pornography + Other (199.85.126.30 and 199.85.127.30)
nameserver 199.85.126.30
nameserver 199.85.127.30
2. I unsquahed /etc/dhcpcd.conf from 001-core.xzm and added "nohook resolv.conf" to the end of it.

3. I placed both of these files into an unsquashed 003-settings.xzm file in the /etc directory.

4. I removed the old 003-settings.xzm file and resquashed squashfs-root into 003-settings.xzm.

5. After creating the new ISO and writing it to a flash drive, I booted to it. I was blocked by Norton ConnectSafe from browsing to elephantlist.org!!!!

Thank you again!

Re: [Solved] DHCP IP Address with Static DNS Possible?

Posted: 18 Oct 2014, 07:07
by fanthom
I unsquahed /etc/dhcpcd.conf from 001-core.xzm
you must be using older version of kiosk, in latest one it's placed in 003-setings.xzm
I removed the old 003-settings.xzm file and resquashed squashfs-root into 003-settings.xzm.
it would be better to keep all your custom tweaks in a separated module like: my_settings.xzm so in case of kiosk upgrade you would have to copy that single module to new ISO.

thanks

Re: [Solved] DHCP IP Address with Static DNS Possible?

Posted: 19 Oct 2014, 04:04
by jmalon
I was using PKE 3.1.1.

Good idea. Do I control the load order for my_settings.xzm by the number in front of it, so it would have to be something like 010_my_settings.xzm?

Re: [Solved] DHCP IP Address with Static DNS Possible?

Posted: 19 Oct 2014, 07:29
by fanthom
3.1.1 is old now :)
yes - you can set the loading order with numbers. or just give it no number so it will be last (letters goes after numbers).

Re: [Solved] DHCP IP Address with Static DNS Possible?

Posted: 07 Apr 2016, 12:57
by sebeling3
I need a more step by step explanation of how to change the resolve.conf. How do I get to that file?

Apologies since I am a total N00B to Porteus and Linux.

Re: [Solved] DHCP IP Address with Static DNS Possible?

Posted: 07 Apr 2016, 20:20
by fanthom
Hello sebeling3,

Please follow our documentation:
http://porteus-kiosk.org/kiosk-customization.html