AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / user-1933443

bragdon's questions

Martin Hope
bragdon
Asked: 2024-09-15 01:46:46 +0800 CST

dnsmasq retornando HTTPS em vez de NODATA

  • 5

Estou tentando configurar um DNS em um servidor Ubuntu usando dnsmasq para pessoas que se conectam à VPN. Não quero que as pessoas pesquisem sites de conteúdo adulto dessa VPN.

Então eu instalo o dnsmask e o configuro para usar uma lista de hosts banindo a maioria dos sites de conteúdo adulto conhecidos: https://github.com/Sinfonietta/hostfiles/blob/master/pornography-hosts

Para pornhub.com está funcionando e recebo os seguintes logs:

dnsmasq[2438]: query[HTTPS] pornhub.com from 10.8.0.4
dnsmasq[2438]: forwarded pornhub.com to x:x:x:x:x:x:x:x
dnsmasq[2438]: query[A] pornhub.com from 10.8.0.4
dnsmasq[2438]: /etc/hosts-porn-content pornhub.com is 0.0.0.0
dnsmasq[2438]: reply pornhub.com is NODATA

No entanto, por algum motivo, quando um site pode ser resolvido por meio de ipv6, o cliente ainda pode acessar o site. Por exemplo, hanime.tv é resolvido mesmo que o dnsmasq encontre a configuração em /etc/hosts-porn-content:

dnsmasq[2438]: query[HTTPS] hanime.tv from 10.8.0.4
dnsmasq[2438]: forwarded hanime.tv to x:x:x:x:x:x:x:x
dnsmasq[2438]: query[A] hanime.tv from 10.8.0.4
dnsmasq[2438]: /etc/hosts-porn-content hanime.tv is 0.0.0.0
dnsmasq[2438]: reply hanime.tv is <HTTPS>

Aqui está minha configuração do dnsmasq:

# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
bind-interfaces
clear-on-reload
filter-AAAA

# If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line.
#no-hosts
# or if you want it to read another file, as well as /etc/hosts, use
# this.
addn-hosts=/etc/hosts-porn-content

configuração systemd-resolve:

[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=127.0.0.1
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
DNSStubListener=no
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no

Configuração do OpenVPN para usar o DNS:

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
push "redirect-gateway def1"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 10.8.0.1"

Conteúdo /etc/hosts:

127.0.0.1 localhost
127.0.1.1 serv

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Tentei desabilitar o IPV6 no computador que executa o servidor DNS, porém o cliente não conseguiu pesquisar nada na web...

E o filtro-AAAA não funciona, pelo menos não entendo o que ele está fazendo.

Por fim, limpo o cache DNS fazendo:

resolvectl flush-caches
pkill -HUP dnsmasq
pkill -USR1 dnsmasq
server
  • 1 respostas
  • 102 Views
Martin Hope
bragdon
Asked: 2024-09-13 15:35:50 +0800 CST

Não é possível controlar o ventilador do antigo computador de mesa HP após instalar o Ubuntu Server 22.04

  • 5

Eu instalei o Ubuntu server 22.04 em um computador antigo HP dekstop de ~(10-15) anos. Antes, ele rodava Windows 7 e os ventiladores não eram barulhentos. Mas agora, os ventiladores estão fazendo muito barulho devido ao alto RPM (~1300 RPM).

Tentei seguir várias respostas de diferentes tópicos relacionados neste fórum sem sucesso. Então aqui está o que eu fiz:

  • Instalei o lm_sensors e executei sudo sensors-detect, e obtive o seguinte:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

# Generated by sensors-detect on Fri Sep 13 08:03:19 2024
# Chip drivers
coretemp
f71882fg
  • Reinício
  • Comando de execução sensors:
sensors
f71858fg-isa-0200
Adapter: ISA adapter
+3.3V:         3.36 V  
3VSB:          3.28 V  
Vbat:          3.25 V  
fan1:        1359 RPM
fan2:         945 RPM
fan3:           0 RPM  ALARM
temp1:        +33.9°C  (high = +70.0°C, hyst = +60.0°C)
temp2:        +33.4°C  (high = +100.0°C, hyst = +85.0°C)
temp3:        +31.9°C  (high = +100.0°C, hyst = +85.0°C)

nouveau-pci-0100
Adapter: PCI adapter
GPU core:    900.00 mV (min =  +0.88 V, max =  +1.08 V)
temp1:        +54.0°C  (high = +95.0°C, hyst =  +3.0°C)
                      (crit = +105.0°C, hyst =  +5.0°C)
                      (emerg = +135.0°C, hyst =  +5.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +34.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:        +25.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:        +28.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:        +19.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:        +32.0°C  (high = +80.0°C, crit = +99.0°C)
  • Corrersudo pwmconfig
# pwmconfig version 3.6.0
This program will search your sensors for pulse width modulation (pwm)
controls, and test each one to see if it controls a fan on
your motherboard. Note that many motherboards do not have pwm
circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.
The program will attempt to restore each fan to full speed
after testing. However, it is ** very important ** that you
physically verify that the fans have been to full speed
after the program has completed.

Found the following devices:
  hwmon0 is nouveau
  hwmon1 is coretemp
  hwmon2/device is f71858fg
  hwmon3 is hidpp_battery_0

Found the following PWM controls:
  hwmon0/pwm1           current value: 13
  hwmon2/device/pwm1           current value: 77
hwmon2/device/pwm1 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm1_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm1.
  hwmon2/device/pwm2           current value: 86
hwmon2/device/pwm2 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm2_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm2.
  hwmon2/device/pwm3           current value: 102
hwmon2/device/pwm3 is currently setup for automatic speed control.
In general, automatic mode is preferred over manual mode, as
it is more efficient and it reacts faster. Are you sure that
you want to setup this output for manual control? (n) y
hwmon2/device/pwm3_enable stuck to 2
Manual control mode not supported, skipping hwmon2/device/pwm3.

Giving the fans some time to reach full speed...
Found the following fan sensors:
  hwmon2/device/fan1_input     current speed: 1362 RPM
  hwmon2/device/fan2_input     current speed: 953 RPM
  hwmon2/device/fan3_input     current speed: 0 ... skipping!

Warning!!! This program will stop your fans, one at a time,
for approximately 5 seconds each!!!
This may cause your processor temperature to rise!!!
If you do not want to do this hit control-C now!!!
Hit return to continue: 

Testing pwm control hwmon0/pwm1 ...
 hwmon2/device/fan1_input ... speed was 1362 now 1390
   no correlation
 hwmon2/device/fan2_input ... speed was 953 now 953
   no correlation

No correlations were detected.
There is either no fan connected to the output of hwmon0/pwm1,
or the connected fan has no rpm-signal connected to one of
the tested fan sensors. (Note: not all motherboards have
the pwm outputs connected to the fan connectors,
check out the hardware database on http://www.almico.com/forumindex.php)

Did you see/hear a fan stopping during the above test (n)? n

Testing is complete.
Please verify that all fans have returned to their normal speed.

The fancontrol script can automatically respond to temperature changes
of your system by changing fanspeeds.

Como o hwmon2/device/pwm1 foi definido como 2, tentei editá-lo para 1 para assumir o controle do pwm manualmente. Tentei o seguinte comando:

cd /sys/class/hwmon/hwmon2/device/
echo 1 > pwm1_enable

No entanto, estou recebendo o seguinte erro:bash: echo: write error: Invalid argument

Além disso, tentei atualizar o driver, mas sem sucesso.

Por fim, tentei atualizar o parâmetro da BIOS que controla o RPM das ventoinhas, mas parece ser somente leitura e a BIOS é tão antiga que não entendo se posso alterar o valor...

Qualquer ajuda seria apreciada =)

Hardware de computador extraído usando sudo lshw:

description: Motherboard
product: 2AB6
vendor: PEGATRON CORPORATION
physical id: 0
version: 1.04
----------------------------
description: BIOS
vendor: AMI
physical id: 0
version: 7.14
date: 05/17/2011
size: 64KiB
capacity: 8MiB
capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification
----------------------------
description: CPU
product: Intel(R) Core(TM) i5-2310 CPU @ 2.90GHz
vendor: Intel Corp.
physical id: 4
bus info: cpu@0
version: 6.42.7
slot: CPU 1
size: 1742MHz
capacity: 3800MHz
width: 64 bits
clock: 100MHz
capabilities: lm fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp xsaveopt dtherm ida arat pln pts md_clear flush_l1d cpufreq
configuration: cores=4 enabledcores=1 microcode=47
----------------------------
description: System Memory
physical id: e
slot: System board or motherboard
size: 4GiB
----------------------------
(Comment if you need to know anything else)

sudo dmidecode -t bios

SMBIOS 2.6 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: AMI
    Version: 7.14
    Release Date: 05/17/2011
    Address: 0xF0000
    Runtime Size: 64 kB
    ROM Size: 8 MB
    Characteristics:
        PCI is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        Boot from CD is supported
        Selectable boot is supported
        BIOS ROM is socketed
        EDD is supported
        5.25"/1.2 MB floppy services are supported (int 13h)
        3.5"/720 kB floppy services are supported (int 13h)
        3.5"/2.88 MB floppy services are supported (int 13h)
        Print screen service is supported (int 5h)
        8042 keyboard services are supported (int 9h)
        Serial services are supported (int 14h)
        Printer services are supported (int 17h)
        ACPI is supported
        USB legacy is supported
        BIOS boot specification is supported
        Targeted content distribution is supported
    BIOS Revision: 7.14

Handle 0x0029, DMI type 13, 22 bytes
BIOS Language Information
    Language Description Format: Abbreviated
    Installable Languages: 12
        eng
        fra
        spa
        ger
        ita
        dan
        fin
        dut
        nor
        por
        swe
        jpn
    Currently Installed Language: fra
server
  • 1 respostas
  • 30 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve