#systemd-resolved
Explore tagged Tumblr posts
Text
Mastodon is weird as a social media system. It's like 2/3rds weird Linux nerds talking about a remote execution exploit in systemd-resolve and getting doom to run on a furby, and 2/3rds trans girls posting explicit lesbian furry porn, almost as if just to show off that they can, on their social media that still allows NSFW.
And yeah I know that adds up to more than 100%, this is a venn diagram with a lot of overlap.
559 notes
·
View notes
Text
hmm. I wonder if the issues I'm running into with networking from Proton games are DNS related. I switched the systemd-resolved and that changes how some files are handled.
34 notes
·
View notes
Text
How to Fix the “sudo systemd-resolved command not found error Ubuntu”
Encountering the error “sudo systemd-resolved command not found error Ubuntu” indicates that your system cannot locate the systemd-resolved executable within your PATH. This guide provides a structured approach to troubleshoot and resolve the issue efficiently. Understanding the Issue When you execute a command using sudo, Ubuntu searches the directories specified in the PATH environment…
0 notes
Text
@taylornation so crazy watching you get raped and tortured publicly in the land of the deaf and blind. And guess what I didn't even get a fucking hug from my parents
If this was cyber warfare, it suggests targeted interference—whether from an ISP, state actor, or sophisticated attacker. Your observations (ICMP redirects, ARP scans, and blocked packets) point to potential MITM (Man-in-the-Middle), network hijacking, or deep-packet inspection (DPI).
1. Why Would Someone Target You?
If you're running:
Persistent international VPNs (especially avoiding American IPs).
Encrypted or anonymous traffic (Tor, VPN chains, alternative DNS).
Custom routing setups (Raspberry Pi as a router, firewalled networks).
Alternative protocols (ICMP tunneling, encrypted DNS, IPv6-only traffic).
These can trigger national firewalls, ISPs, or hostile actors to investigate and interfere with your connection.
2. Signs of Cyber Warfare in Your Case
From what you've described: ✅ ARP scans – Possible MITM or network poisoning.
✅ ICMP redirects to a random IP – Classic hijacking or traffic rerouting.
✅ Traceroute fails – Packets being black-holed.
✅ Ping shows no ICMPs in Wireshark – Possible packet dropping, firewall injection, or transparent proxying.
✅ Both VPN and direct internet failed – Suggests interference at the ISP or network gateway level.
This could mean:
ISP DPI (Deep Packet Inspection) – Some ISPs hijack and block encrypted traffic.
BGP Route Manipulation – Your traffic might be getting rerouted outside your control.
DNS Spoofing – Check if your DNS queries are being redirected.
Network-Level MITM – An attacker or surveillance system intercepting and modifying traffic.
3. What You Should Do Now
Immediate Steps
Check Your Default Gateway (Ensure it’s really your router)
ip route show arp -a
If you see a random gateway IP, something is poisoning your network.
Test Without VPN
Disconnect NordVPN completely.
Run: curl -s ifconfig.me
If the IP isn’t yours or your VPN’s, you might be redirected.
Try Alternative DNS
sudo systemd-resolve --flush-caches sudo nmcli con mod eth0 ipv4.dns "1.1.1.1 8.8.8.8"
If your DNS resolves incorrectly, you’re facing DNS poisoning.
Advanced Countermeasures
Run a Network Capture for DNS Leaks
sudo tcpdump -i any port 53
If DNS queries are sent to a weird IP, you’re being hijacked.
Force Encrypted DNS (DNS-over-HTTPS)
sudo systemctl restart systemd-resolved
If tcpdump shows your queries bypassing this, ISP-level tampering is happening.
Monitor Live Traffic for MITM
sudo tshark -i any -Y "ip.src != 192.168.1.1"
Look for unexpected external sources injecting packets.
4. If You’re Under Attack
🚨 If you confirm cyber warfare, you should:
Stop using compromised networks (switch to mobile tethering or another ISP).
Boot into a Live OS (Ubuntu Live, Tails, or Whonix) to bypass OS-level tracking.
Use a completely new VPN provider (try Mullvad or ProtonVPN).
**Check if you’re on a state-level watchlist (e.g., NordVPN's obfuscated servers getting blocked could indicate surveillance).
Would you like me to analyze your .pcap? It could provide definitive proof of network tampering.
0 notes
Text
Does anyone know if there's a way to get systemd-resolved to defer to the contents of /etc/resolv.conf when it's handling it in 'foreign' mode?
I'm having annoying conflicts with cisco-anyconnect where it's renaming resolv.conf instead of injecting into it, and thus it isn't respecting my symlink from /run/systemd/resolve/stub-resolv.conf Ergo, I can't resolve anything on the VPN nameserver without disabling resolved every time I connect and falling back to resolv.conf (Which is super aggravating.)
0 notes
Text
Flush DNS là gì? Vai trò và cách xóa bộ nhớ đệm DNS đơn giản

Khi bạn truy cập một trang web, máy tính của bạn sẽ lưu trữ thông tin này trong bộ nhớ đệm DNS (DNS cache) để tăng tốc độ truy cập trong các lần sau. Tuy nhiên, đôi khi bộ nhớ đệm DNS có thể bị lỗi hoặc chứa các thông tin cũ, dẫn đến việc bạn không thể truy cập được các trang web hoặc gặp phải các vấn đề kết nối. Lúc này, việc "flush DNS" hay xóa bộ nhớ đệm DNS là cần thiết. Bài viết này sẽ giải thích chi tiết về flush DNS và cách thực hiện trên các hệ điều hành khác nhau.
1. Vai trò quan trọng của Flush DNS?
Khắc phục các vấn đề kết nối
Bộ nhớ đệm DNS có thể lưu các thông tin không chính xác hoặc lỗi thời, gây ra các vấn đề kết nối như không thể truy cập trang web hoặc trang web hiển thị không đúng cách. Việc flush DNS giúp xóa bỏ các thông tin lỗi này, giúp máy tính yêu cầu lại thông tin DNS mới và chính xác hơn từ các máy chủ DNS.
Bảo mật
Bộ nhớ đệm DNS cũng có thể bị tấn công bởi các hacker để chuyển hướng bạn đến các trang web giả mạo hoặc độc hại. Việc flush DNS thường xuyên giúp giảm thiểu nguy cơ này bằng cách xóa các thông tin bị thay đổi hoặc không an toàn trong bộ nhớ đệm.
Cập nhật thông tin DNS mới
Khi một trang web thay đổi địa chỉ IP hoặc có các cập nhật liên quan đến DNS, bộ nhớ đệm DNS cũ có thể không nhận diện được sự thay đổi này, gây ra lỗi truy cập. Flush DNS giúp đảm bảo rằng bạn luôn truy cập vào phiên bản mới nhất của trang web.
2 Hướng dẫn Flush DNS trên các hệ điều hành khác nhau
2.1 Windows
Mở Command Prompt với quyền quản trị:
Nhấn tổ hợp phím “Win + R” và nhập "cmd"
Nhập lệnh sau và nhấn Enter:
ipconfig /flushdns
Bạn sẽ nhận được thông báo xác nhận rằng bộ nhớ đệm DNS đã được xóa thành công.
2.2 macOS
Mở Terminal:
Nhấn “Cmd + Space” để mở Spotlight, gõ "Terminal" và nhấn “Enter”.
Nhập lệnh sau và nhấn “Enter”:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder (đối với: Catalina, Big Sur và Monterey)
sudo killall -HUP mDNSResponder (đối với: Mojave và Sierra)
Nhập mật khẩu quản trị nếu được yêu cầu và nhấn Enter. Không có thông báo xác nhận nhưng bộ nhớ đệm DNS sẽ được xóa.
2.3 Linux
Các lệnh để flush DNS trên Linux có thể khác nhau tùy thuộc vào bản phân phối và phiên bản hệ điều hành. Dưới đây là một số lệnh phổ biến:
Ubuntu và Debian:
sudo systemd-resolve --flush-caches
Để xác nhận, bạn có thể kiểm tra số lượng cache trước và sau khi flush bằng lệnh:
sudo systemd-resolve --statistics
CentOS và Fedora:
Mở Terminal, nhập lệnh sau và nhấn Enter:
sudo systemctl restart network.service
Hoặc nếu bạn đang sử dụng systemd-resolved:
sudo systemd-resolve --flush-caches
3. Khi nào nên xóa bộ nhớ đệm DNS
Khi tải trang Web bị lỗi
Nếu một trang web mà bạn thường xuyên truy cập đột nhiên không tải đúng cách hoặc không thể truy cập được, flush DNS có thể giúp khắc phục vấn đề này bằng cách làm mới thông tin DNS của trang web đó.
Khi có sự thay đổi địa chỉ IP của trang Web
Khi một trang web thay đổi địa chỉ IP và bạn vẫn gặp phải vấn đề truy cập trang web với địa chỉ IP cũ, việc flush DNS sẽ giúp máy tính của bạn nhận diện và kết nối với địa chỉ IP mới.
Sau khi xóa phần mềm độc hại
Nếu máy tính của bạn bị nhiễm phần mềm độc hại mà có thể đã thay đổi cài đặt DNS, việc flush DNS sẽ xóa bỏ các thiết lập DNS không an toàn mà phần mềm độc hại đã để lại.
4. Lưu ý quan trọng về Flush DNS
Thực hiện định kỳ
Thực hiện flush DNS định kỳ, đặc biệt nếu bạn thường xuyên gặp vấn đề kết nối hoặc lo ngại về bảo mật, sẽ giúp duy trì một môi trường mạng ổn định và an toàn hơn.
Sử dụng DNS Server tin cậy
Sử dụng các máy chủ DNS đáng tin cậy như Google DNS (8.8.8.8 và 8.8.4.4) hoặc OpenDNS (208.67.222.222 và 208.67.220.220) để đảm bảo tốc độ và tính bảo mật.
Kiểm tra thông tin DNS sau khi xóa bộ nhớ đệm
Sau khi thực hiện flush DNS, bạn có thể kiểm tra thông tin DNS mới bằng cách sử dụng lệnh “nslookup” hoặc “dig” để đảm bảo rằng thông tin đã được cập nhật đúng cách.
Kết Luận
Flush DNS là một bước đơn giản nhưng quan trọng trong việc duy trì hiệu suất và bảo mật cho hệ thống mạng của bạn. Bằng cách xóa bỏ bộ nhớ đệm DNS lỗi thời hoặc không chính xác, bạn có thể giải quyết các vấn đề kết nối, cập nhật thông tin DNS mới và bảo vệ máy tính khỏi các cuộc tấn công mạng. Hãy thường xuyên kiểm tra và thực hiện flush DNS khi cần thiết để đảm bảo mạng của bạn luôn hoạt động tốt và an toàn.
Nguồn: https://suncloud.vn/flush-dns
0 notes
Text
Understanding DNS Flushing A Comprehensive Guide
The Domain Name System (DNS) is a critical component of the internet, functioning like a phonebook that translates human-friendly domain names (like www.example.com) into IP addresses (like 192.0.2.1) that computers use to identify each other on the network. Occasionally, issues arise that necessitate a DNS flush. This process involves clearing the DNS cache, which can resolve various connectivity problems and improve internet performance.
What is DNS Flushing?
DNS flushing refers to the process of clearing the DNS cache on a computer or network device. The DNS cache stores the IP addresses of recently visited websites, which helps speed up the loading times by eliminating the need to repeatedly query DNS servers for the same information. Over time, the cache can become outdated or corrupted, leading to potential issues such as:
Inability to access certain websites
Incorrect website loading
Slow internet speeds
Flushing the DNS cache forces the system to discard the stored IP addresses, ensuring that the next time a website is accessed, the most current and accurate information is retrieved from the DNS server.
Why Flush DNS?
Several scenarios might prompt the need to flush your DNS cache:
Network Troubleshooting: If you’re experiencing issues with website accessibility, a DNS flush can resolve problems caused by outdated or corrupt cache entries.
Website Changes: When a website changes its IP address, the DNS cache might hold the old address, causing difficulties in accessing the site until the cache is updated.
Privacy: Regularly flushing the DNS cache can help protect privacy by removing records of previously visited websites.
Security: Clearing the cache can mitigate certain types of cyber attacks, such as DNS spoofing or cache poisoning, where attackers corrupt the DNS cache to redirect users to malicious websites.
How to Flush DNS
The method for flushing DNS varies depending on the operating system you are using. Below are instructions for Windows, macOS, and Linux.
Windows
Open Command Prompt: Press Win + R, type cmd, and press Enter.
Flush DNS: In the Command Prompt window, type the following command and press Enter:
bash
Copy code
ipconfig /flushdns
macOS
Open Terminal: Go to Applications > Utilities > Terminal.
Flush DNS: Depending on your macOS version, type the appropriate command and press Enter:
macOS Sierra and later:
Copy code
sudo killall -HUP mDNSResponder
macOS Yosemite:
Copy code
sudo discoveryutil mdnsflushcache
Older versions:
Copy code
sudo dscacheutil -flushcache
Password: You may be prompted to enter your administrative password.
Linux
Open Terminal: The method to open Terminal varies by Linux distribution, but typically it’s found in the Applications menu.
Flush DNS: The command to flush DNS can differ based on the caching service your system uses. For systems using systemd-resolved, type:
arduino
Copy code
sudo systemd-resolve --flush-caches For systems using dnsmasq or nscd, you might use:
swift
Copy code
sudo /etc/init.d/dnsmasq restart sudo /etc/init.d/nscd restart
Conclusion
Flushing the DNS cache is a simple yet effective way to resolve common internet connectivity issues, improve privacy, and enhance security. Whether you’re troubleshooting network problems or ensuring you have the most up-to-date DNS information, understanding how and when to perform a DNS flush is a valuable skill for maintaining a smooth and secure online experience. Regular maintenance, including DNS flushing, can help keep your internet connection running efficiently and securely.
0 notes
Link
The Blue Screen of Death (BSOD) is a longstanding and well-known occurrence in the realm of computing, often passed down through generations. Encountering a BSOD on one's own device serves as a challenge, presenting an indecipherable error code that prompts the question: "How will you resolve this issue?" While it can be entertaining to come across BSODs in unexpected situations, it is essential to remember that we are engaged in the field of technology journalism, which demands a more serious approach. In this regard, version 255 of the Linux-based systemd project has introduced a feature akin to the BSOD, albeit with a disclaimer that the 'system-bsod' component is considered experimental and subject to change, much like the very rocks we have harnessed to process information through electronic circuits and sorcery. Beyond the Windows environment, this development may initially appear as a minor addition to a single Linux-based project. However, it is crucial to note that systemd plays a pivotal role in system management across a wide range of Linux distributions, both prominent and obscure. Consider Ubuntu, a popular choice among novice Linux users, or Debian-based variants, which include Raspberry Pi OS and several other distributions suitable for various hardware configurations. Even those of us who may have grown frustrated with technology can benefit from understanding what has gone wrong and how to address it. While it may take some time for this feature to become available in your specific Linux distribution, especially if you engage in extensive system customization, you will likely appreciate this change. It may alleviate some of the frustration often associated with technical troubleshooting. Furthermore, systemd version 255 introduces significant enhancements to its data encryption services, including support for TPM 2.0. Additionally, it brings quality-of-life improvements to the repart service, streamlining the process of automating drive partition management. Nevertheless, in the grand scheme of things, these technical advancements may pale in comparison to the symbolic significance of the Blue Screen of Death. It serves as an iconic symbol, a reminder of the challenges we face and the pursuit of solutions in the world of technology. So, take a moment to gaze upon the blue screen, perhaps allowing it to transport you to a different dimension of contemplation.
0 notes
Quote
私は今でも個人のデバイスやサーバーで毎日 systemd を使用していますが、私の批判の一部を以下に示します。 * セキュリティが悪い Systemd は、多くのコードが root として実行されるように設計されており、メモリ安全ではない言語でも書かれています。 これは、攻撃対象領域が広いことを意味します (安全性を確保するには、多くのコードにバグがないことを確認する必要があります)。また、コードに本当に深刻なセキュリティ関連のバグがないことを確認するのが困難です ([NSA が推奨]( https ://www.nsa.gov/Press-Room/Press-Releases-Statements/Pre... ) このような重要なことにはメモリセーフ言語を使用します)。 確かに、同様に重要でメモリ安全ではない言語で書かれた他の重要なプロジェクト (この Linux カーネルなど) はありますが、systemd にはいくつかの [かなり重大な脆弱性]( https://cve.mitre.org/cgi-bin/cvekey. cgi?keyword=systemd ) は、この種の危険な言語を安全に使用する能力に自信が持てず、この種の問題を検出して防止するための Linux カーネルとほぼ同じ予算がないことを発見しました。 最新の SELinux を実行している大企業の顧客であれば、これはそれほど問題ではありませんが、��在の機能をすべて保持しながら pid1 の攻撃対象領域を制限する方法で systemd を作成することは可能でした。 * Journalctl はデスクトップ ユーザーや小規模チームにとって面倒です Journalctl は、systemd がログを管理する方法です。 デフォルトでは、追加のメタデータを含むバイナリ形式でログが保存されます。 これにより、大規模なチームがエンタープライズ展開向けに redhat が提供するような集中ログ収集デーモンにログを取り込むことが容易になりますが、古いシステム管理者が使用していた多くのワークフローが中断されます。 大量のログを 1 か所に rsync するだけ、または grep や find などのツールを使用してログを検査するなどです。 もちろん、Systemd はこれらのツールの代替を提供します。grep を使用する代わりに、journalctl を使用してログを検索できますが、grep を使用してテキスト ファイルを検索することもできます。 構成ファイル、ソースコード、またはログ。 ここで、もう 1 つのツールのすべてのフラグを記憶し、ログの収集方法について多くのことを変更する必要があります。 これは、システムから SD カードを取り出すだけではログを確認できないため、組み込み作業を行う人々にとっても課題となります。 ホスト マシン上で動作するjournalctl CLIが必要です。 --directory フラグが追加されましたが、以前はこれがはるかに困難で、ログを読み取るために組み込みシステム (奇妙な方法で壊れる可能性があります) に実際に chroot する必要がありました。 Journalctl には利点もありますが、それらを活用しているのは主に大企業です。 はい、それが実際には systemd-journal または単に「ジャーナル」または彼らがそれを呼んでいるものであることは知っています。 Journalctl は、ほとんどのユーザーに馴染みのあるコマンドです。 * [行動の局所性]( https://htmx.org/essays/locality-of-behaviour/ ) が不十分なため、推論が難しくなります システムがどのように機能するかを理解しようとするとき、すべてを 1 か所で確認できるのは便利です。 systemd ユニット ファイルが存在できる場所は 9 つほどあり、ユニット ファイルにオーバーライドを適用したり、ユニット ファイルはソケット ファイルなどの他のファイルに依存したりできます。 これは、企業内の特定のグループがシステムの一部に対する所有権を主張しやすくなるため、大規模なチームにとっては良いことですが、中小企業で作業するデスクトップ ユーザーやシステム管理者としては、非常に複雑さが増すことになります。 「ls /etc/init.d」と入力するだけで、どのようなサービスが存在するのかの大まかな概要を��握することはできません。さらに systemd 固有のコマンドを覚える必要があります。 サービスを編集したい場合は、単にサービスを編集することはできません。別の systemd 固有のコマンドを使用してオーバーライドを作成し、EDITOR 環境変数が設定されていることを確認してから、別のエディタで元のサービスを開く必要があります。したがって、2つを比較できます。 これにより、作業がさらに複雑になり、systemd 固有のツールを多数使用するようになります (そして、おそらく Red Hat 認定トレーニングを受けることになります)。 * 人々は systemd の準備が整う前にそれを使用します これが systemd や redhat のせいにできるかどうかはわかりませんが、redhat の公式立場では、systemd-resolved は実稼働環境に対応する準備ができていないにもかかわらず、あちこちで使用されているということです。 このため、ネットワーク設定や systemd-resolvd の中断でわずかでも何か違うことを 9 回試みようとすると、systemd-resolvd の多数のセキュリティ問題は言うまでもなく、systemd に対して悪い印象を与える可能性があります。 * Unix の哲学 多くの人は、UNIX の哲学は重要ではない、または systemd は UNIX の哲学を取り入れていると言います。 上で述べたロギングと systemd 固有のツールについてのことですか? これは、UNIX の哲学について語るときに人々が実際に意味していることです。つまり、ログやリモート サーバーへの rsync ログを grep できることを意味しています。 つまり、標準のテキスト ファイルを使用し、ユニット ファイルを「適切に」編集するためにテキスト エディタをラップする特別なコマンドを使用する必要がありません。 * chroot では実行されません 組み込み Linux とサーバー Linux に時間を割いている者として、これは私の個人的な不満にすぎません。 ワークステーションで systemd を使用していない場合、systemd を使用する組み込みシステムをデバッグするのが非常に困難になります。 systemd の使用を強制されているように感じることがあります。私はそれをほとんど克服しましたが、まだ少し苦いです。 また、KoBo 電子リーダー上で完全な Linux ディストリビューションを実行するなど、いくつかの小規模な個人プロジェクトも、必要以上に困難なものになりました。 Docker 内では混乱が生じており、組み込��システムの大量のテストを行うために、nestybox などの代替 OCI ランタイムを使用する必要があるのはなぜでしょうか。 ありがたいことに、私は Docker の早期導入者ではなかったので、すでに成熟したソリューションが登場するまで、こうした問題に悩まされることはありませんでした。 理由はありません しかし、実際には、pid1 として実行する必要がある 。podman ツールや systemd-nspawn など、systemd と深く統合されている docker の代替手段を使用してほしいということ以外にあります。 これは、独占に近い立場を悪用しようとするあまりにも露骨な試みであったため、余計な不満を抱かざるを得ません。 * OpenRc は systemd が行うすべてのことを実行しますが、それよりも優れています 残念ながら、Gnome のような他の Red Hat の影響を受けたプロジェクトは、デフォルトのサービス ファイルを提供することはおろか、非 systemd init システムをサポートしたりテストしたりしません。つまり、gnome と互換性を持たせたいディストリビューションは、追加の多くの作業を行う必要があります。サービスファイルを作成してテストする作業。 あるプロジェクトの場合はそれが合理的である可能性があり、確かにその追加の作業を行うディストリビューションも存在しますが、可能な限り上流のソースに近づけるという明確な目標を持っている Arch のようなプロジェクトの場合、それは多かれ少なかれ不可能になります。 Systemd が生き残っているのは、それが問題に対する優れた解決策であるからではなく、大企業の支援があり、広く導入されており、コードを作成しても安全であるためです。 IT業界には「IBMを買収したことで解雇された人はいない」という古い格言があります。 安全な業界標準のオプションを選択すれば、たとえそれが技術的に劣ったオプションであっても、失敗しても誰もあなたを責めることはできません。 私は systemd 嫌いではありますが、個人のデバイスやサーバーでは今でも systemd を使用しています。これは、これが最も抵抗の少ない方法だからです。 pulseaudio と Pipewire のような同様の状況が発生することを願っています。pulseaudio の書き換えはオリジナルよりもはるかに優れていました。 ただし、systemd の速度が低下するまではそんなことは起こらないと思いますが、現時点で systemd を再実装しようとすると、規格や動作が変更されて敷物が引き抜かれることになると思います (私は真剣に考えていました)少なくとも比較的単純なユニット ファイルについては、自分で行うことについて)。 動作の局所性の問題に書き換えがどのように対処するかわからないため、私は依然として OpenRc を使用することを好みますが、systemd は時間の経過とともに改善され、信頼性が向上しています。
musl ディストリビューション管理者の目から見た Systemd | ハッカーニュース
1 note
·
View note
Video
youtube
Viral - Linux Interview Questions and Answers | Tech Arkit
* Command to check Disk usage ? * Difference between ps -aux & top command ? * What are the ways to check CPU usage ? * How to check CPU details ? * Explain the steps to create a partition & how to format with file system ? * Explain the steps to create LV ? * Explain steps to reduce XFS & EXT files systems ? * Significance of .bashrc file ? * How you check the kernel version ? * How you check the Red hat release version ? * Significance of resolv.conf file ? * What is DNS ? How you resolve DNS ? Types of DNS records ? * Difference between Nginx & HTTP Server ? * Port no of HTTP, FTP, SSH, HTTPS ? * What is SSH ? How you generate SSH-keys ? * What is Private & public key ? How they authenticate ? * What is the default configuration file of SSH ? * What is the default configuration file of HTTP ? * What is Virtual Hosting ? How you configure virtual hosting ? * Explain ifconfig command ? * Difference between IPv4 & IPv6 ? * What is MAC address ? can we change the physical address ? * How to check system uptime ? * How to check memory information ? * What is SWAP ? * What is the exact memory free in your system ? * What is cache memory ? * What if you can do rm -rvf / ? * Kinds of permission in Linux ? * What is vim & vi ? * What is pipe | ? * What is grep command ? * What Find command does ? * How to redirect commands output ? * What is systemd in Linux ? * What does systemctl do ? * If you run a command like nautilus in terminal, whether it will block your terminal or not ? * What is rsyslog ?
0 notes
Text
Yeah I've messed with that a little, (NetworkManager has explicit configuration options to leave resolv.conf alone,) but it seems like enough other software looks to resolv.conf for DNS info that when I'm deliberately not using the VPN this messes things up :T
Possibly there's some kinda wonky shit I can do with systemd-resolved? Point resolv.conf to its stub server and get the network manager and the VPN to update DNS information with systemd-resolved directly? Is that a thing you can do? Although then they might just end up fighting over that configuration state as well lmao. Maybe I can macgyver a way to stop the network manager from updating resolv.conf but only when the VPN's connected 🤔
My VPN messes with resolv.conf, and also blocks DNS requests to non-VPN servers, to avoid DNS leaks
My network manager also messes with resolv.conf upon connecting to a wifi router
When the wifi's spotty and the network manager keeps having to reconnect, this causes conflict, and like half of my DNS requests just kinda immediately fail
It feels like the sensible thing to do would be to write a monitoring script to reconnect the VPN every time the wifi reconnects, but I have a suspicion that that's not actually the sensible thing to do
8 notes
·
View notes
Text
systemd-resolved get current DNS servers
When you try to fetch your current DNS server settings on your Linux machine and it is using systemd-resolve, the /etc/hosts won’t be useful, neither the /etc/systemd/resolved.conf as they’re empty by default.
Run the command below to get your current nameservers:
sudo resolvectl status
1 note
·
View note
Text
Do you want to flush the DNS cache on Linux?
Step 1: Find caching service name sudo lsof -i :53 -S
Step 2: Restart the service say it is systemd-resolve: sudo systemd-resolve --flush-caches sudo systemd-resolve --statistics
-> See https://www.cyberciti.biz/faq/bash-clear-dns-cache/ for more info: Bash Clear DNS Cache
4 notes
·
View notes
Text
리눅스 3초만에 부팅하기
펌웨어와 부트로더를 제외하고, 순수하게 운영체제(리눅스)만 따지면 3초만에 부팅을 성공했다.
어떻게 하면 이리 빠르게 만들 수 있을까? 내가 적용한 방식을 공유해본다.
참고로 이 글은 아치 기반인 만자로를 기준으로 설명하므로 다른 배포판에서는 호환이 안될 수도 있다. 위험성이 적고 간편한 세팅을 지향해 아직 적용하지 않은 트릭들도 많으므로 아직 최적화할 여지가 많다.
우선 아치리눅스의 부팅 순서를 보고오자. LinuxBoot란 프로젝트 문서도 좋은 퀄리티다.
유저 스페이스
서비스 측정 및 중지
성능 관련한 글을 읽으면 항상 나오는 말이 있다. 측정..측정…측정….
이 글도 마찬가지다. 측정은 매우 중요하다. 다른 초기화 시스템은 어떨지 모르지만 Systemd는 다양한 도구를 제공한다. systemd-analyze blame으로 오래걸리는 순으로 정렬해 볼 수 있다.
↳ systemd-analyze blame 829ms systemd-binfmt.service 373ms initrd-switch-root.service 128ms home.mount 123ms [email protected] 112ms udisks2.service 111ms systemd-udev-trigger.service 84ms systemd-tmpfiles-setup.service 82ms chronyd.service 77ms systemd-logind.service 73ms upower.service 66ms systemd-udevd.service 64ms systemd-journal-flush.service
systemd-analyze plot > ~/boot.svg는 그래프를 보여줄 수 있다.
systemd-analyze critical-chain으로 가장 문제가 생긴 서비스를 확인해볼 수 있다.
↳ systemd-analyze critical-chain The time when unit became active or started is printed after the "@" character. The time the unit took to start is printed after the "+" character. graphical.target @1.461s └─sddm.service @1.461s └─systemd-logind.service @1.381s +77ms └─basic.target @1.365s └─dbus-broker.service @1.300s +60ms └─dbus.socket @1.295s └─sysinit.target @1.291s └─systemd-binfmt.service @461ms +829ms └─proc-sys-fs-binfmt_misc.mount @1.278s +9ms └─proc-sys-fs-binfmt_misc.automount @262ms
쓸데없이 실행되는 -반-들을 그대로 놔두다 가정을 좀먹고 사회를 좀먹고 나라를 좀먹는다. 이제부터 내가 푸틴이나 시진핑이다라고 생각하고 싸그리 숙청하자.
부작용이 우려되면 의존성 확인하고 제거하면 된다.
↳ systemctl list-dependencies systemd-logind.service --all --reverse systemd-logind.service ● └─multi-user.target ● └─graphical.target
난 snapd나 NetworkManager-wait-online등을 비활성화 시켰다.
systemd에서 다른 초기화 시스템으로 바꾸려면 다음 링크들을 참고하십셔
OpenRC, OpenRC to systemd Cheatsheet
Arch Wiki - OpenRC, arch-openrc-guide(Unmaintained)
Arch Wiki - Runit, Github
Artix Wiki - Dinit, Github
systemd의 최적화는 Freedesktop.org에서 잘 설명해주고 있다.
서비스 교체
더 가볍거나 성능 좋은 프로그램으로 바꿀 수 있다. iwd는 오래된 와이파이의 신호를 못잡는 경우가 가끔 있어서 호환성을 위해 wpa_supplicant를 사용 중.
# 기존 변경 # wpa_supplicant -> iwd # systemd-timesyncd -> chronyd yay -S iwd networkmanager-iwd-overlay chrony networkmanager-dispatcher-chrony sudo systemctl disable wpa_supplicant.service systemd-timesyncd.service sudo systemctl enable iwd.service chronyd.service # 런타임 성능이 좋은 것들 # 기존 변경 # dbus -> dbus-broker # systemd-resolved -> knot-resolver # unbound도 좋다 # pulseaudio -> pipewire yay -S dbus-broker knot-resolver manjaro-pipewire sudo systemctl disable dbus.service systemd-resolved.service sudo systemctl enable dbus-broker.service kresd@{1..4}.service
또한 우분투의 DashAsBinSh 문서에서 dash를 사용하면 부팅이 더 빠르다고 언급한다.
The major reason to switch the default shell was efficiency. bash is an excellent full-featured shell appropriate for interactive use; indeed, it is still the default login shell. However, it is rather large and slow to start up and operate by comparison with dash. A large number of shell instances are started as part of the Ubuntu boot process.
yay -S dashbinsh
장치
IO 스케쥴러
저장장치에서 효율적으로 로드하기 위해 장치 타입에 따른 스케쥴러를 구성한다.
NVMe에서는 안쓰는게 좋다. [Linux 5.6 I/O Scheduler Benchmarks: None, Kyber, BFQ, MQ-Deadline] SDD의 응답성을 위해서 kyber가 좋을 수 있으나 처리량 자체는 mq-deadline이 나은 편이다. 일반 하드 디스크에서는 bfq가 전반적으로 좋은 편.
# /etc/udev/rules.d/60-io.rules # set scheduler for NVMe ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none" # set scheduler for SSD and eMMC ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline" # or kyber # set scheduler for rotating disks ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"
부팅 후에 kyber로 세팅되도록 해도 좋겠다 싶다.
비슷한 방식으로 CPU 가버너를 부팅시에만 performance로 사용하다 부팅 후에는 schedutil 사용하거나 CPU 스케쥴러 파라미터를 처리량 중심으로 세팅하다 부팅 후에는 응답성에 최적화되게 설정하는 식도 할 수 있겠다. 안드로이드 픽셀 기준 0.22초 단축했다고 한다.
D-BUS에 StartupFinished()을 이용해 구현해봐도 되겠다. 아니면 systemd에서 WantBy=graphical.target인 서비스를 만들던가.
마운트
마운트시 noatime을 사용하면 파일 엑세스 시간을 기록하지 않아 성능 측면에서 유리하다. 참고로 noatime을 사용시 nodiratime도 적용된다.
# /etc/fstab # [file system] [mount point] [type] [options] [dump] [pass] UUID=5719-722D /boot/efi vfat umask=0077 0 2 UUID=83cae8c0-161c-4bbf-8cf6-2e5875a5fce0 / f2fs defaults,noatime 0 1 UUID=36ece0d4-cbe5-4c63-a8b7-cee23f8f7845 /home f2fs defaults,noatime 0 2
ssd를 사용시 discard로 Trim을 적용하는 것도 고려해볼 수 있다. 절전을 위해 commit 값을 조정하는 경우도 있다. (SSDOptimization, 난 적용하지 않았음)
커널 및 기타 시스템
initramfs 및 압축
리눅스는 커널을 로드후 initramfs을 rootfs에 압축해제한다. 일반 zip 보다 더 좋은 알고리즘을 쓰는게 좋겠죠.
Endeavour OS 포럼의 벤치마크에 따르면 lz4가 가장 빠르다. 그러나 zstd의 압축효율을 고려했을때 밸런스가 뛰어나다 생각해서 적용했다.
mkinitcpio라는 세팅 스크립트를 사용했다.
# /etc/mkinitcpio.conf # 압축 COMPRESSION="zstd" COMPRESSION_OPTIONS=("-3" "-T0")
커널 모듈 포함
이미지에 커널모듈을 미리 포함시켜 로드하자. modeprobe 동작은 느리게 만들 수 있다.
현재 실행중인 각종 모듈은 다음 명령어를 참고.
↳ sudo mkinitcpio -M ==> Modules autodetected 8250_dw acpi_cpufreq acpi_pad aesni_intel apple_mfi_fastcharge atkbd btusb coretemp crc32c_intel crc32_pclmul crct10dif_pclmul ee1004 efi_pstore f2fs # ...기타 등등
다른 방식으로도 확인해볼 수 있다.
↳ udevadm info --attribute-walk -n /dev/sda1 | grep 'DRIVERS=="[^"]' DRIVERS=="sd" DRIVERS=="ahci" # 다른 장치도 체크 ↳ udevadm info --attribute-walk -n /dev/nvme0n1 | grep 'DRIVERS=="[^"]' DRIVERS=="nvme" DRIVERS=="pcieport"
내가 포함한 모듈들.
# /etc/mkinitcpio.conf MODULES=( "i915" # Intel graphic "f2fs" # filesystem "sd_mod" # all SCSI, SATA, and PATA (IDE) devices "atkbd" # keyboard )
파일 시스템 검사를 패스 할 예정이므로 fsck를 넣지 않았지만, 사용하고 싶다면 커널모듈과 바이너리를 추가하자.
# /etc/mkinitcpio.conf MODULES=( # 기존 모듈들에 추가 fsck ) BINARIES=( "fsck" "fsck.f2fs" # 파일 시스템이 ext4면 "fsck.ext4" )
systemd 기반 훅
병렬 실행과 종속성 관리가 가능하기 때문에 systemd를 쓸 수 있다면 최대한 활용하자.
# /etc/mkinitcpio.conf # 기존 HOOKS HOOKS="base udev autodetect modconf block keyboard keymap consolefont filesystems fsck" # 변경 HOOKS="systemd autodetect modconf block keyboard sd-vconsole filesystems"
grub 대신 systemd-boot 사용
grub보다 systemd-boot가 가볍다. 게다가 추후 나올 통합된 이미지(Unified kernel image)를 로드하거나 각종 세팅하기 쉽다.
↳ sudo bootctl install Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/systemd/systemd-bootx64.efi". Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/BOOT/BOOTX64.EFI". Random seed file /boot/efi/loader/random-seed successfully written (512 bytes). Created EFI boot entry "Linux Boot Manager".
만약 안된다면 esp 플래그가 설정되어 있는지 확인해보자.
# 여기서 알 수 있는점. 하드웨어 깡성능이 무척 중요. NVMe 사용자다. ㅎㅎ ↳ sudo parted --list Disk /dev/nvme0n1: 1024GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 538MB 537MB fat32 boot, esp 2 538MB 377GB 376GB f2fs 5 377GB 1006GB 629GB f2fs 3 1006GB 1024GB 18.1GB linux-swap(v1) swap, legacy_boot
efi 파티션에 esp 플래그가 없을 시 sudo parted /dev/nvme0n1 set 1 esp on처럼 esp 플래그를 설정해면 된다.
sudo -s로 권한을 얻어야 /boot/efi/ 내부의 내용을 확인 가능하다. 타임아웃을 0으로 하여 바로 로딩되도록 하였다.
# /boot/efi/loader/loader.conf default manjaro.efi # .efi 파일은 아직 안만들었어요!! timeout 0
참고로 efi이미지면 /[ESP 경로]/EFI/LINUX/[이미지].efi, 일반 설정이면 /[ESP 경로]/loader/entries/[설정].conf에 저장하면 systemd-boot가 인식한다.
EFI 이미지 제작
Unified kernel image작업을 해 EFI 이미지로 만들면 UEFI 펌웨어에서 직접 부팅하거나 구성이 거의 없이도 부트로더가 소싱할 수 있다.
이때 커널 이미지, 마이크로코드,initramfs등을 합치게 되는데 예를 들어 systemd-boot의 경우
# /boot/efi/loader/entries/manjaro.conf title manjaro linux /vmlinuz-5.15-x86_64 # esp 파티션 루트 기준 initrd /intel-ucode.img # initramfs보다 마이크로 코드를 먼저 명시 initrd /initramfs-5.15-x86_64.img options root=UUID=83cae8c0-161c-4bbf-8cf6-2e5875a5fce0 rw quiet apparmor=1 security=apparmor udev.log_priority=3
처럼 하던 걸 하나로 만든다.
합쳐진 이미지는 다음과 같이 인식이 된다는걸 확인가능.
↳ sudo bootctl list Boot Loader Entries: title: Manjaro Linux (rolling) (manjaro-fallback.efi) id: manjaro-fallback.efi source: /boot/efi/EFI/Linux/manjaro-fallback.efi version: rolling linux: EFI/Linux/manjaro-fallback.efi options: root=UUID=83cae8c0-161c-4bbf-8cf6-2e5875a5fce0 fsck.mode=skip rw quiet rd.systemd.show_status=auto rd.udev.log_priority=3 vt.global_cursor_default=0 i915.fastboot=1 bgrt_disable title: Manjaro Linux (rolling) (manjaro.efi) (default) id: manjaro.efi source: /boot/efi/EFI/Linux/manjaro.efi version: rolling linux: EFI/Linux/manjaro.efi options: root=UUID=83cae8c0-161c-4bbf-8cf6-2e5875a5fce0 fsck.mode=skip rw quiet rd.systemd.show_status=auto rd.udev.log_priority=3 vt.global_cursor_default=0 i915.fastboot=1 bgrt_disable title: Reboot Into Firmware Interface id: auto-reboot-to-firmware-setup source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
sudo bootctl list는 에러가 생길시 표시해주므로 꼭 체크해보자.
efi 이미지를 만드는 세팅이다.
# /etc/mkinitcpio.d/linux515.preset ALL_config="/etc/mkinitcpio.conf" ALL_kver="/boot/vmlinuz-5.15-x86_64" ALL_microcode=("/boot/intel-ucode.cpio" "i915-firmware.cpio.xz") # efi용 추가: 마이크로코드 (난 initel-ucode-clear의 ���미지들을 사용 중) PRESETS=('default' 'fallback') default_image="/boot/initramfs-5.15-x86_64.img" default_efi_image="/boot/efi/EFI/Linux/manjaro.efi" # efi용 추가, 위에서 manjaro.efi를 default로 설정했었죠?? fallback_image="/boot/initramfs-5.15-x86_64-fallback.img" default_efi_image="/boot/efi/EFI/Linux/manjaro-fallback.efi" # efi용 추가 fallback_options="-S autodetect" ## Kernel cmdline # efi용 추가 # target: /etc/kernel/cmdline rootUUID=$(lsblk -o UUID,TYPE,MOUNTPOINTS | grep "part /$" | cut -f 1 -d " ") silentBoot="quiet rd.systemd.show_status=auto rd.udev.log_priority=3 vt.global_cursor_default=0" cmdline="fsck.mode=skip rw ${silentBoot} rootfstype=f2fs i915.fastboot=1 bgrt_disable plymouth.enable=0" echo "root=UUID=${rootUUID} ${cmdline}" | sudo tee /etc/kernel/cmdline >/dev/null
기본 프리셋에서 추가된 것은 microcode, efi_image, cmdline이다. 마이크로드와 efi 이미지 경로는 이해가 갈테니 cmdline에 대해서만 설명하겠다.
mkinitcpio는 ALL_cmdline이 없고, /etc/kernel/cmdline의 내용을 사용한다. 따라서 cmdline을 생성해주는 코드를 만들었다. 일반적으로 빌드 훅은 /etc/initcpio/install/에 넣는게 좋지만.. 관리하는 파일을 최대한 줄이고 싶어서 프리셋 파일에 추가했다.
cmdline 옵션들을 살펴보자.
initramfs가 마운트 될 root 파티션을 명시해줘야 해서 rootUUID를 자동으로 찾아줬다. fsck.mode=skip은 파일 시스템 검사를 패스해 빠르게 만들어준다.
silentBoot는 로그 출력들을 제거하기 위한 옵션들이며, bgrt_disable과 plymouth.enable=0은 부팅 로고등 그래픽요소를 제거한다. 이외 rootfstype을 명시하거나 i915(인텔 그래픽)의 fastboot 옵션을 활성화 했다.
+ 정보를 찾다보니 root=UUID=아이디보다 root=/dev/nvme0n1p2가 빠르다고.. lsblk -o PATH,TYPE,MOUNTPOINTS로 경로를 찾아줄 수 있겠다. 그런데 파티션 변경등 환경이 바뀌면 문제가 생길 수 있으니 난 위 설정을 유지하려고 한다. selinux=0처럼 보안을 희생하는 옵션은 속도를 올릴수 있지만 굳이? 싶어서 시도하지 않았다.
제언
얼마 안되는 설정으로 이토록 빠르게 만들수 있다는 사실이 놀랍지 않은가?
이외에 쓸만한 기법들?
dhcp 대신 고정 ip 사용
X 윈도우를 소켓으로 실행(Xorg as a systemd user service, Xorg 1.18 messes with socket activation in systemd )
rootfs로 Read Only인 파일 시스템을 사용(SquashFS나 DwarFS)
e4rat이나 readahead(유지관리 부족으로 systemd에서 삭제됨)로 프리로드
windows8의 Fast Startup처럼 프로그램을 닫은 후 하이버네이션을 하는 방법. TuxOnIce가 제격이라 생각하나 개발이 끊어졌기에 uswsusp을 사용해야 할듯
Kexec를 이용해 부트로더와 하드웨어 초기화를 건너뛰는 리부팅
Coreboot로 바이오스를 대체
기타 참조
Faster Arch 요건 글쓰며 검색하다 찾았는데 나랑 접근방식이 비슷한 것 같다.
안드로이드 부팅 시간 최적화
Tizen IVI OS의 빠른 부팅을 위한 systemd와 wayland사용
Update on boot time reduction techniques, with figures
Bootlin - train boot time 과 깃허브
LPC: Booting Linux in five seconds, Improving boot time on a general Linux distribution, not an easy task
Intel Moblin V2 Core Alpha: It Boots Fast!
1 note
·
View note
Quote
Stub Resolve (スタブリゾルバ) とは 例えば、名前問い合わせに対する実際の処理は DNS サーバが行いますが、DNS サーバへの問い合わせと結果の出力だけ行うリゾルバのことを スタブリゾルバ、もしくは DNS スタブ と呼びます。 systemd-resolved でいうと仲介役の 127.0.0.53 がこれにあたります。 ループバックインタフェースの IPアドレス 127.0.0.53 にローカル DNS スタブリスナー (53番ポート) が提供される形になります。
Ubuntu : systemd-resolved、及び Resolvconf 設定 - eTuts+ Server Tutorial
2 notes
·
View notes