Quản lý bản ghi DNS cục bộ
Trên macOS, việc quản lý bản ghi DNS cục bộ rất hữu ích cho việc phát triển, kiểm thử và gỡ lỗi ứng dụng mạng. ServBay cung cấp một máy chủ dnsmasq cục bộ, giúp việc thêm, sửa đổi, tạm ngừng và xóa bản ghi DNS trở nên dễ dàng hơn. Bài viết này sẽ chi tiết về cách sử dụng ServBay để quản lý bản ghi DNS cục bộ.
TIP
Đối với các trang web được thêm từ chức năng máy chủ ServBay, các bản ghi này sẽ hiển thị biểu tượng quả địa cầu 🌐 bên phải bản ghi DNS. Các bản ghi này cần phải được quản lý thông qua chức năng 'máy chủ', không thể quản lý trực tiếp trong bản ghi DNS.
Xem bản ghi DNS cục bộ hiện tại
Thông qua ServBay, bạn có thể dễ dàng xem nội dung bản ghi DNS cục bộ hiện tại. ServBay sử dụng máy chủ dnsmasq để xử lý các bản ghi này, giúp việc quản lý trở nên dễ dàng hơn.
Các bước xem
- Mở giao diện quản lý ServBay.
- Điều hướng đến
DNS
. - Trong danh sách bên phải, chọn
DNS Server
. - ServBay sẽ hiển thị nội dung các bản ghi DNS hiện tại.
Bằng cách này, bạn có thể xem trực quan tất cả các tên miền và IP đã được cấu hình.
Thêm một bản ghi DNS cục bộ
Trong quá trình phát triển hoặc kiểm thử, bạn có thể cần ánh xạ tên miền nhất định đến địa chỉ IP cụ thể. Thông qua ServBay, bạn có thể dễ dàng thêm một bản ghi DNS cục bộ.
Các bước thêm
- Mở giao diện quản lý ServBay.
- Điều hướng đến
DNS
. - Trong danh sách bên phải, chọn
DNS Server
. - Nhấn nút
+
. - Nhập tên miền và địa chỉ IP tương ứng, ví dụ:
servbay.demo 127.0.0.1
1 - Nhấn nút
thêm
.
Điều này sẽ thêm mới bản ghi tên miền và địa chỉ IP vào bản ghi DNS cục bộ.
TIP
ServBay hỗ trợ thêm nhiều địa chỉ IP, cũng như thêm địa chỉ IPv6. Hãy phân tách nhiều địa chỉ IP bằng dấu phẩy (,).
Sửa đổi bản ghi DNS cục bộ
Đôi khi, bạn cần phải sửa đổi ánh xạ tên miền và địa chỉ IP hiện có. Thông qua ServBay, bạn có thể dễ dàng sửa đổi bản ghi DNS cục bộ.
Các bước sửa đổi
- Mở giao diện quản lý ServBay.
- Điều hướng đến
DNS
. - Trong danh sách bên phải, chọn
DNS Server
. - Tìm bản ghi cần sửa đổi.
- Nhấn vào bản ghi.
- Trong bảng điều khiển bên phải, sửa đổi tên miền hoặc địa chỉ IP, ví dụ:
servbay.demo 127.0.0.1 -> servbay.demo 10.0.0.1
1 - Nhấn nút
lưu
.
Điều này sẽ cập nhật bản ghi DNS cục bộ với bản ghi đã chỉ định.
Tạm ngừng giải quyết một bản ghi DNS cục bộ
Trong một số trường hợp, bạn có thể cần tạm ngừng giải quyết một bản ghi mà không xoá nó. Thông qua ServBay, bạn có thể dễ dàng thực hiện điều này.
Các bước tạm ngừng
- Mở giao diện quản lý ServBay.
- Điều hướng đến
DNS
. - Trong danh sách bên phải, chọn
DNS Server
. - Tìm bản ghi cần tạm ngừng.
- Nhấn vào nút
tạm ngừng
bên cạnh bản ghi.
ServBay sẽ tự động tạm ngừng giải quyết bản ghi, và biểu tượng trước bản ghi sẽ chuyển từ màu xanh sang màu xám.
Xóa một bản ghi DNS cục bộ
Nếu một bản ghi không còn cần thiết, bạn có thể sử dụng ServBay để xóa nó khỏi bản ghi DNS cục bộ.
Các bước xóa
- Mở giao diện quản lý ServBay.
- Điều hướng đến
DNS
. - Trong danh sách bên phải, chọn
DNS Server
. - Tìm bản ghi cần xóa.
- Nhấn vào nút
xóa
bên cạnh bản ghi. - Xác nhận thao tác xóa.
Điều này sẽ xóa ánh xạ tên miền và địa chỉ IP khỏi bản ghi DNS cục bộ.
Tổng kết
ServBay cung cấp một giao diện đơn giản để quản lý bản ghi DNS cục bộ trên macOS, giúp việc xem, thêm, sửa đổi, tạm ngừng và xóa bản ghi trở nên dễ dàng và trực quan hơn. Thông qua các chức năng này, bạn có thể phát triển, kiểm thử và gỡ lỗi ứng dụng mạng một cách hiệu quả hơn. Dù là thêm ánh xạ tên miền mới hay sửa đổi bản ghi hiện có, ServBay luôn đáp ứng nhu cầu của bạn và đảm bảo tính linh hoạt và kiểm soát của môi trường mạng cục bộ. Sử dụng máy chủ dnsmasq của ServBay, bạn có thể dễ dàng quản lý bản ghi DNS cục bộ, nâng cao hiệu quả trong quá trình phát triển và kiểm thử. Đối với các trang web được thêm từ chức năng máy chủ của ServBay, bạn cần quản lý thông qua chức năng 'máy chủ' để đảm bảo độ chính xác và nhất quán của tất cả các bản ghi.