[Solved] DHCP IP Address with Static DNS Possible?

New features which should be implemented in Porteus Kiosk Edition and the kiosk wizard.
Post Reply
jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

[Solved] DHCP IP Address with Static DNS Possible?

Post#1 by jmalon » 03 Oct 2014, 03:35

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!
Last edited by jmalon on 17 Oct 2014, 22:11, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#2 by fanthom » 03 Oct 2014, 07:36

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?
Please add [Solved] to your thread title if the solution was found.

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#3 by jmalon » 03 Oct 2014, 14:45

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.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#4 by fanthom » 03 Oct 2014, 15:30

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).
Please add [Solved] to your thread title if the solution was found.

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#5 by jmalon » 17 Oct 2014, 19:42

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!

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#6 by fanthom » 17 Oct 2014, 20:11

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.
Please add [Solved] to your thread title if the solution was found.

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#7 by jmalon » 17 Oct 2014, 20:38

I'll give it a try and let you know. Thank you again for your help!

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#8 by jmalon » 17 Oct 2014, 21:22

Is /etc/dhcocd.conf in the 001-core.xzm, instead of 003-settings.xzm?

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#9 by jmalon » 17 Oct 2014, 21:56

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!

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#10 by fanthom » 18 Oct 2014, 07:07

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
Please add [Solved] to your thread title if the solution was found.

jmalon
Black ninja
Black ninja
Posts: 78
Joined: 21 Mar 2013, 19:39
Distribution: Linux Mint
Location: Collinsville, OK

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

Post#11 by jmalon » 19 Oct 2014, 04:04

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?

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#12 by fanthom » 19 Oct 2014, 07:29

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).
Please add [Solved] to your thread title if the solution was found.

sebeling3
Ronin
Ronin
Posts: 1
Joined: 06 Apr 2016, 19:44
Distribution: 3.1
Location: Philadelphia

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

Post#13 by sebeling3 » 07 Apr 2016, 12:57

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.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

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

Post#14 by fanthom » 07 Apr 2016, 20:20

Hello sebeling3,

Please follow our documentation:
http://porteus-kiosk.org/kiosk-customization.html
Please add [Solved] to your thread title if the solution was found.

Post Reply