SEO Metadata
SEO Title Options
- Linux Network Configuration: Static IP, DNS & Netplan on
- Linux Network Configuration: Static IP: Practical 2026
- Networking Playbook: Linux Network Configuration: Static
Meta Description Options
- Learn Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu with a practical Networking framework, expert mistakes, implementation steps, examples.
- Covers Netplan YAML syntax, setting static IPs, configuring DNS resolvers, bonding interfaces, and troubleshooting with ip and ss commands.
URL Slug
linux-network-configuration-static-ip-dns-netplan-ubuntu
Focus Keyword
Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu
Additional LSI Keywords
- Networking
- Linux
- Ubuntu
- Netplan
- DNS
- Static IP
- Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu
- production checklist
- implementation guide
- best practices
- architecture decisions
- testing strategy
Table of Contents
- Article overview
- What Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu means
- Why it matters now
- Implementation framework
- Practical comparison
- Expert workflow
- Common mistakes
- Media and link plan
- Original technical deep dive
- FAQ
- Structured data
- Conclusion
Article overview
Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu is the kind of topic that looks simple until it reaches production. Teams usually discover the real cost late: unclear boundaries, weak defaults, hidden maintenance work, and decisions that seemed harmless when the codebase was small.
The problem gets worse when the article, tutorial, or implementation guide only explains the happy path. This guide closes that gap with a practical framework, a comparison table, common mistakes, and a deep technical section you can use while planning real work.
Keep reading for the non-obvious part: the safest implementation is rarely the most impressive-looking one. It is the one your team can debug, test, document, and evolve without turning every future change into archaeology.
Key Takeaways
- Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu should be evaluated as a production decision, not only as a syntax or tooling choice.
- The best implementation keeps responsibilities visible, with clear ownership, tests, documentation, and rollback paths.
- Search visibility improves when practical depth, structured answers, and expert examples live on the same page.
[IMAGE: A mobile-first technical article layout showing the main concept, decision table, implementation checklist, and FAQ blocks. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu expert guide for Networking]
What Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu means
Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu means applying networking knowledge to a concrete engineering decision, then turning that decision into reliable code, documentation, and operational behavior. In practice, it combines the topic's core concepts with trade-off analysis, implementation boundaries, testing strategy, and maintenance discipline.
This is the definition worth optimizing for featured snippets because it avoids hype. It tells the reader what the topic does and what a professional implementation must include.
Why it matters now
The technical web is more crowded than it was a few years ago. Thin tutorials can still get indexed, but they rarely earn trust from senior developers, buyers, AI answer systems, or teams that need production guidance.
For networking topics, the strongest content now has three layers:
- a clear answer for fast scanning
- a practical framework for implementation
- expert context that explains what breaks later
That same structure helps search engines understand the page. It also helps readers decide whether the advice fits their project.
Implementation framework
Use this framework before adopting the approach described in this article.
- Define the user problem and the production risk.
- Identify the smallest reliable implementation boundary.
- Keep configuration, secrets, and environment-specific behavior outside the article's core logic.
- Add tests for the behavior that would hurt if it regressed.
- Document the trade-off, not only the final code.
- Measure the result with logs, metrics, or user-facing outcomes.
- Revisit the decision after real usage exposes edge cases.
The sequence is deliberately conservative. It keeps the work grounded in outcomes instead of novelty.
[IMAGE: A seven-step implementation framework with discovery, boundary design, configuration, tests, documentation, measurement, and iteration. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu implementation framework]
Practical comparison
| Decision area | Strong approach | Weak approach | Why it matters |
|---|---|---|---|
| Scope | Solve one clear problem | Mix unrelated concerns | Focus improves testing and search intent |
| Architecture | Put logic in explicit classes or documented boundaries | Hide behavior in templates or incidental callbacks | Future changes stay easier to review |
| Data flow | Pass prepared data into the view or endpoint | Query or compute in presentation code | Reduces regressions and performance surprises |
| Testing | Cover the risky behavior directly | Test only the happy path | Catches production failures earlier |
| Documentation | Explain trade-offs and limits | Repeat generic definitions | Builds E-E-A-T and reader trust |
| Operations | Track logs, metrics, and rollback steps | Ship without measurement | Makes the decision reversible |
This table is intentionally practical. It gives a reviewer something to check before the implementation becomes expensive to change.
Expert workflow
Expert tip: "Treat Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu as a system boundary. If the next developer cannot find where the decision lives, how it is tested, and when it should be avoided, the implementation is not finished."
A useful workflow is simple:
- Start with the smallest working example.
- Add the constraints that exist in your real project.
- Remove anything that only demonstrates cleverness.
- Write down the failure modes.
- Add links to related decisions so future readers can navigate the topic cluster.
That last point matters for both humans and search systems. A single article can answer a question; a cluster proves authority.
Common mistakes
Mistake 1: Copying a pattern without its context
A pattern that works in a small demo can fail in a real application. The missing context is usually data volume, team experience, deployment process, security requirements, or observability.
Before copying the pattern, ask what assumption made it safe in the original example.
Mistake 2: Putting business logic in the wrong layer
This is the fastest way to make future debugging expensive. In Laravel, PHP, and server-rendered websites, presentation should receive prepared data, not discover rules on its own.
Keep decision logic in models, actions, services, policies, requests, jobs, or documented helpers where it can be tested directly.
Mistake 3: Optimizing for novelty instead of maintainability
Newer tools and language features can be valuable. They can also hide simple behavior behind unfamiliar syntax.
Use the option that makes the next production incident easier to understand.
Mistake 4: Publishing without a measurement plan
If the article describes a performance, SEO, security, or architecture improvement, define how success will be checked. Logs, tests, crawl diagnostics, analytics, and user behavior are all stronger than assumptions.
[IMAGE: A common-mistakes board with context loss, wrong layer, novelty bias, and missing measurement highlighted. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu common mistakes]
Media and link plan
Image placeholders
- [IMAGE: A concept diagram for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu with input, decision boundary, implementation, tests, and production feedback. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu concept diagram]
- [IMAGE: A mobile screenshot-style checklist for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu mobile checklist]
- [IMAGE: A comparison table visualization for strong versus weak implementation choices. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu comparison table]
Video placeholder
[VIDEO: Insert a 5-8 minute YouTube walkthrough that demonstrates the main decision, the implementation boundary, the test strategy, and the production caveats for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu.]
Trustworthy outbound links
- Linux manual pages - use this as the trust reference for operating-system reference.
- Google Search quality guidance - use this as the trust reference for people-first content and E-E-A-T alignment.
Internal linking opportunities
- Internal guide: Setting Up a Linux DNS Server With BIND9 - use this when readers need a related Networking follow-up.
- Internal guide: How to Set Up a Linux VPN Server With - use this when readers need a related Networking follow-up.
Original Technical Deep Dive
The short version
Ubuntu Server uses Netplan for persistent network configuration. Netplan reads YAML files from /etc/netplan/, renders configuration for systemd-networkd or NetworkManager, and applies it to the running system.
For a normal Ubuntu Server with a static IPv4 address, use this shape:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
- 1.1.1.1
search:
- example.com
Then validate and apply:
sudo netplan generate
sudo netplan try
sudo netplan apply
If you are changing networking over SSH, use netplan try first. It can roll back when you lose connectivity and fail to confirm the change.
Know what manages the interface
On Ubuntu Server, the renderer is usually networkd:
renderer: networkd
On Ubuntu Desktop, NetworkManager usually owns the network:
renderer: NetworkManager
Check existing files before editing:
ls -l /etc/netplan
sudo find /etc/netplan -maxdepth 1 -type f -name '*.yaml' -print -exec sed -n '1,160p' {} \;
Check the merged Netplan view:
netplan get
Check runtime state:
netplan status
networkctl status
If the machine is cloud-provisioned, cloud-init may have written the Netplan file. Do not create a second file that configures the same interface differently unless you know the merge order.
Identify the interface name
List links:
ip link
List addresses:
ip address
Show one interface:
ip address show dev enp3s0
Show current routes:
ip route
Show DNS state:
resolvectl status
Common interface names look like:
| Name | Typical meaning |
|---|---|
enp3s0 | PCI Ethernet device |
ens160 | VMware-style Ethernet device |
eno1 | Onboard Ethernet |
eth0 | Legacy or cloud image naming |
wlp2s0 | Wireless interface |
Do not guess the interface name. Use the name the system actually reports.
Make a safe edit
Create a backup:
sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.$(date +%F).bak
If your system uses a different filename, back up that file instead.
Open the config:
sudoedit /etc/netplan/00-installer-config.yaml
Keep YAML indentation consistent. Use spaces, not tabs.
Set conservative permissions:
sudo chmod 600 /etc/netplan/*.yaml
Validate generated backend config:
sudo netplan generate
For remote hosts, test with rollback:
sudo netplan try --timeout 120
If the network still works, confirm the prompt. If you lose SSH, wait for rollback before reconnecting.
Apply permanently:
sudo netplan apply
Configure DHCP
Basic DHCP:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: true
Apply:
sudo netplan generate
sudo netplan apply
Verify:
ip address show dev enp3s0
ip route
resolvectl status enp3s0
Use DHCP when your router, DHCP server, cloud platform, or virtualization provider is supposed to assign the address.
Configure a static IPv4 address
Example network:
Interface: enp3s0
Address: 192.168.10.20/24
Gateway: 192.168.10.1
DNS: 192.168.10.53, 1.1.1.1
Search: example.com
Config:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: false
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
- 1.1.1.1
search:
- example.com
Validate and apply:
sudo netplan generate
sudo netplan try
sudo netplan apply
Verify:
ip address show dev enp3s0
ip route get 1.1.1.1
ping -c 3 192.168.10.1
ping -c 3 1.1.1.1
resolvectl query ubuntu.com
On older Ubuntu 18.04 systems, to: default may not be supported. Use the older gateway4 form there:
gateway4: 192.168.10.1
For current Ubuntu releases, prefer the routes form.
Configure IPv6
Static IPv6 with a default route:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 192.168.10.20/24
- 2001:db8:10::20/64
routes:
- to: default
via: 192.168.10.1
- to: default
via: 2001:db8:10::1
nameservers:
addresses:
- 192.168.10.53
- 2001:4860:4860::8888
Verify IPv6 routing:
ip -6 address show dev enp3s0
ip -6 route
ip -6 route get 2001:4860:4860::8888
ping -6 -c 3 2001:4860:4860::8888
If your network uses router advertisements, you may not need static IPv6 routes. Check what the network is supposed to provide before hard-coding IPv6.
Configure DNS resolvers
Netplan configures DNS through systemd-resolved on typical Ubuntu Server installs. Do not edit /etc/resolv.conf as the main fix; it is usually a symlink managed by the resolver stack.
[IMAGE: Supporting visual 1 for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu, showing Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu decisions, examples, and Linux, Ubuntu, Netplan. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu linux-network-configuration-static-ip-dns-netplan-ubuntu visual 1]
[IMAGE: Supporting visual 1 for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu, showing Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu decisions, examples, and Linux, Ubuntu, Netplan. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu linux-network-configuration-static-ip-dns-netplan-ubuntu visual 1]
Static DNS:
nameservers:
addresses:
- 192.168.10.53
- 1.1.1.1
search:
- example.com
- corp.example.com
Check the symlink:
ls -l /etc/resolv.conf
Check resolver state:
resolvectl status
resolvectl dns enp3s0
resolvectl domain enp3s0
Query a name:
resolvectl query app.example.com
resolvectl query ubuntu.com
If DHCP provides DNS but you want to ignore it, use DHCP overrides:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: true
dhcp4-overrides:
use-dns: false
nameservers:
addresses:
- 192.168.10.53
- 1.1.1.1
That keeps DHCP addressing but uses your configured DNS servers.
Configure multiple static addresses
One interface can hold multiple addresses:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 192.168.10.20/24
- 192.168.10.21/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
Verify:
ip address show dev enp3s0
Use this for services that genuinely need more than one address. Do not use extra IPs to work around application routing or virtual host configuration problems.
Pin an interface by MAC address
Interface names can change when hardware or firmware changes. For important servers, match by MAC address and set a predictable name:
network:
version: 2
renderer: networkd
ethernets:
lan0:
match:
macaddress: "52:54:00:12:34:56"
set-name: lan0
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
Find the MAC:
ip link show
Be careful on remote systems. If the MAC is wrong, the config will not match the real device.
Configure bonding
Bonding combines multiple physical interfaces into one logical interface. Common use cases:
- active-passive failover;
- switch-connected LACP aggregation;
- redundant NICs on servers.
Active-backup bond:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: false
optional: true
enp4s0:
dhcp4: false
optional: true
bonds:
bond0:
interfaces:
- enp3s0
- enp4s0
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
parameters:
mode: active-backup
primary: enp3s0
mii-monitor-interval: 100ms
LACP bond:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: false
optional: true
enp4s0:
dhcp4: false
optional: true
bonds:
bond0:
interfaces:
- enp3s0
- enp4s0
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
nameservers:
addresses:
- 192.168.10.53
parameters:
mode: 802.3ad
lacp-rate: fast
mii-monitor-interval: 100ms
transmit-hash-policy: layer3+4
For 802.3ad, the switch ports must be configured as an LACP group. If the switch is not configured correctly, the Linux side can look fine while traffic still fails or uses only one link.
Verify a bond:
ip address show dev bond0
cat /proc/net/bonding/bond0
networkctl status bond0
Check member links:
ip link show dev enp3s0
ip link show dev enp4s0
Add a static route
Route a private subnet through a specific next hop:
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 192.168.10.20/24
routes:
- to: default
via: 192.168.10.1
- to: 10.50.0.0/16
via: 192.168.10.254
Verify route selection:
ip route get 10.50.20.30
ip route get 1.1.1.1
If the gateway is outside the interface subnet, you may need on-link: true, but use that only when the network provider explicitly requires it.
Temporary changes with ip
The ip command changes runtime state immediately. These changes are useful for rescue work and testing, but they do not survive reboot.
Add a temporary address:
sudo ip addr add 192.168.10.99/24 dev enp3s0
Bring a link up:
sudo ip link set dev enp3s0 up
Add a temporary default route:
sudo ip route add default via 192.168.10.1
Remove an address:
sudo ip addr del 192.168.10.99/24 dev enp3s0
Flush addresses from an interface:
sudo ip addr flush dev enp3s0
Do not treat temporary ip commands as configuration management. Once the fix is known, put it into Netplan.
Check listening services with ss
ss shows sockets. Use it when network reachability looks correct but a service is not accepting connections.
[IMAGE: Supporting visual 2 for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu, showing Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu decisions, examples, and Linux, Ubuntu, Netplan. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu linux-network-configuration-static-ip-dns-netplan-ubuntu visual 2]
Show listening TCP and UDP sockets with process names:
sudo ss -tulpn
Check a specific port:
sudo ss -tulpn | grep ':22'
sudo ss -tulpn | grep ':80'
sudo ss -tulpn | grep ':443'
Show established TCP connections:
ss -tan state established
Show TCP socket details:
ss -ti dst 192.168.10.10
If ip route get 192.168.10.10 is correct but ss -tulpn shows no service listening, the problem is not Netplan. Start debugging the service.
[IMAGE: Supporting visual 2 for Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu, showing Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu decisions, examples, and Linux, Ubuntu, Netplan. Alt: Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu linux-network-configuration-static-ip-dns-netplan-ubuntu visual 2]
Troubleshooting order
Use this order when a server disappears or cannot reach the network:
- Console into the host if SSH is risky.
- Check YAML syntax with
sudo netplan generate. - Check the merged config with
netplan get. - Check interface state with
ip link. - Check addresses with
ip address. - Check default route with
ip route. - Check route choice with
ip route get 1.1.1.1. - Check DNS with
resolvectl statusandresolvectl query. - Check sockets with
ss -tulpn. - Check backend renderer logs with
journalctl.
Commands:
sudo netplan --debug generate
sudo netplan apply
netplan status
ip link
ip address
ip route
ip route get 1.1.1.1
resolvectl status
resolvectl query ubuntu.com
sudo ss -tulpn
journalctl -u systemd-networkd --since '30 minutes ago' --no-pager
journalctl -u systemd-resolved --since '30 minutes ago' --no-pager
Common failures:
| Symptom | Likely cause |
|---|---|
netplan generate fails | YAML indentation, invalid key, bad boolean, duplicate mapping |
| Interface has no address | Wrong interface name, wrong MAC match, renderer mismatch |
| Gateway is unreachable | Wrong subnet mask, wrong VLAN, wrong default route, switch issue |
| DNS fails but ping by IP works | Resolver config, systemd-resolved, bad DNS server, search suffix issue |
| SSH dies after apply | Wrong address, wrong gateway, remote firewall, no netplan try rollback |
| Bond is up but traffic fails | Switch LACP mismatch, wrong bond mode, disconnected member, VLAN mismatch |
| Port is closed | Service not listening, firewall, service bound to localhost only |
Production checklist
Before changing a production server:
[ ] You have console or out-of-band access.
[ ] Current /etc/netplan files are backed up.
[ ] Interface names and MAC addresses are verified.
[ ] Static address, prefix, gateway, DNS, and search domains are confirmed.
[ ] Cloud-init ownership of network config is understood.
[ ] YAML validates with netplan generate.
[ ] Remote changes use netplan try.
[ ] Route selection is verified with ip route get.
[ ] DNS is verified with resolvectl query.
[ ] Listening services are verified with ss.
[ ] The final YAML is committed to infrastructure configuration.
FAQ
What is Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu?
Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu is a practical networking topic that should be evaluated through implementation scope, production risk, testing, documentation, and long-term maintainability.
When should a team use Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu?
Use Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu when it solves a real project constraint, improves clarity, or reduces operational risk. Avoid it when it only adds novelty or hides behavior from future maintainers.
What is the biggest risk with Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu?
The biggest risk is copying a pattern without its context. Production systems need clear boundaries, rollback options, tests, and observability before a technique becomes dependable.
How do you test Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu?
Test the smallest unit that owns the behavior, then add integration coverage for the path users or systems actually rely on. Include failure cases, configuration differences, and regression checks.
How does Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu affect SEO and AI search visibility?
It improves visibility when the article gives a direct answer, expert context, structured headings, internal links, trustworthy references, and FAQ content that matches the visible page.
Conclusion
Linux Network Configuration: Static IP, DNS & Netplan on Ubuntu is worth doing when the implementation improves clarity, reliability, or delivery speed. It is not worth doing when it hides ownership, increases operational risk, or makes the system harder to explain.
Use the framework above as a review checklist. Then connect this topic to the rest of the project documentation so readers can move from concept to implementation without losing context.