Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

Saturday, June 4, 2022

Assign a different DNS for a host in OpenWRT

There are occasions which I would like to set a host to use a different DNS server than the general DNS server set for the network.  I can do this easily with OPNSense however I can't seem to find the option in OpenWRT.  Initially it thought this isn't possible.  As it turns out, this is only not possible with Luci but it is doable if you are comfortable to tweak the configuration file directly.

To assign a host to use a specific DNS server, you need to edit the /etc/config/dhcp file.  For example, if I want to set my smart TV to use DNSForge.de instead of the Google DNS on my network, I need to assign a static address to my tv, and tag it with the "tag" option.  Then set the "dhcp_option" to the tagged host as below:

 

config host option dns '1' option ip '10.0.0.200' option name 'tv' option mac 'FF:1A:6B:1A:9A:9B' option tag 'tv_dns' option leasetime '300' config tag 'tv_dns' list dhcp_option '6,176.9.93.198,176.9.1.117'


ref: https://forum.openwrt.org/t/configure-host-specific-dns-server-over-dhcp-option-6/71471/4

ref: https://zedt.eu/tech/linux/how-to-serve-custom-dhcp-configuration-with-openwrt-dnsmasq/

Wednesday, May 15, 2013

Xubuntu, KVM and Display Resolution


If you are like me who use a KVM switch to control multiple computers, you may run into resolution problem with Ubuntu.

Since the computer is not being connected to the monitor directly, it may not get the DDC information from the monitor to set the resolution correctly.  In my case, I was stuck at 1024x768@60KHz.

A quick google search brought me to this nice post that helps me get pass the 1024x768.

https://www.tecmint.com/set-display-screen-resolution-in-ubuntu/

Here are few quick notes on steps I took.

1) Use cvt   1920   1080 to produce a modeline, e.g.

# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
2) Then made this available for selection

xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
 Use xrandr to get the ID for your display, e.g. VGA-1
$ xrandr
 
 
$ xrandr --addmode VGA-1 "1920x1080_60.00"

3) Test the new resolution option by using your system Display setting tool, e.g.




If the setting works for you, then you can make this permanent by adding a little profile file to /etc/profile.d/, e.g.


$ sudo vim /etc/profile.d/external_monitor_resol.sh
Within this file, just add the two xrandr lines you were using earlier, e.g.



xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA-1 "1920x1080_60.00"



Now restart your system.  The new resolution should stay if things are done correctly.

 

Edited 2021-04-22:

It seems there is a simpler alternative.

1) Use xrandr to find out the supported resolutions, e.g.

 


2) In my case, 1920x1080@60 is the resolution I am aiming for.  Now, edit the grub file to tell the kernel about this resolution by adding video=1920x1080@60 as a parameter to the GRUB_CMDLINE_LINUX_DEFAULT option like below:





3) Run update-grub to apply the settings

After reboot, this new resolution should now be available to the system.

 

ref: https://askubuntu.com/questions/973499/wayland-how-to-set-a-custom-resolution